[GHC] #10344: Make BranchList simpler
GHC
ghc-devs at haskell.org
Fri Apr 24 13:03:03 UTC 2015
#10344: Make BranchList simpler
-------------------------------------+-------------------------------------
Reporter: goldfire | Owner: goldfire
Type: task | Status: new
Priority: normal | Milestone:
Component: Compiler | Version: 7.11
Resolution: | Keywords:
Operating System: Unknown/Multiple | Architecture:
Type of failure: None/Unknown | Unknown/Multiple
Blocked By: | Test Case:
Related Tickets: | Blocking:
| Differential Revisions:
-------------------------------------+-------------------------------------
Comment (by goldfire):
Replying to [comment:2 simonpj]:
> Yes yes! Simple is good! Needs a comment to stress that in the
`BranchedList` case the list may legitimately be empty.
But a `BranchList Branched` currently still can't be empty -- Adam's empty
CTF patch uses the `Maybe (CoAxiom Branched)` approach to deal with empty
CTFs. Consumers of `fromBranchList` assume they're getting a non-empty
list.
So, we could do
{{{
data BranchList a br where
OneBranch :: a -> BranchList a Unbranched
ManyBranches :: a -> [a] -> BranchList a Branched -- requires at least
one element
}}}
This is certainly simpler than the current story.
--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/10344#comment:3>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
More information about the ghc-tickets
mailing list