google-code-export / omega

Automatically exported from code.google.com/p/omega
Other
2 stars 0 forks source link

LabelNotEq should hold ordering information #69

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Now LabelNotEq is a not applicable unary data constructor that holds an
Int. This integer is always zero. I propose to hold values of type

<http://haskell.org/ghc/docs/latest/html/libraries/ghc-prim/GHC-Ordering.html#t%
3AOrdering>

so that labels can be productively put into binary trees. Alternatively
keep the Int, but fill in:
samelabel `a `b --> LabelNotEq 1
samelabel `b `a --> LabelNotEq -1

Original issue reported on code.google.com by ggr...@gmail.com on 1 Dec 2009 at 12:20

GoogleCodeExporter commented 9 years ago
actually we are better now than what I suggested:

prompt> :t LabelNotEq 
LabelNotEq  :: forall ('a:Tag:*1) ('b:Tag:*1).Ordering -> DiffLabel 'a 'b

prompt> sameLabel `a `b
(R (LabelNotEq LT)) : ((Equal `a `b)+(DiffLabel `a `b))

prompt> sameLabel `c `b
(R (LabelNotEq GT)) : ((Equal `c `b)+(DiffLabel `c `b))

Fixed in r320 and r321.

Original comment by ggr...@gmail.com on 9 Mar 2010 at 11:17