[Haskell-cafe] Unique Ordered Types
eir at cis.upenn.edu
Thu Aug 13 02:21:30 UTC 2015
I'm the author of the units package. Yes, the types are annoying and painfully indirect, exactly because of the problem you identify.
CmpSymbol might work for you. Note that it works only on Symbols (type-level strings) and not arbitrary types. I didn't like it because I wanted it to be possible to leverage Haskell's module system to allow distinct units but with the same name, declared in different modules. (For example, "pound" can refer to a plethora of different units.) This requirement may have been a step too far, and I'd be curious to see how much the system could be simplified without it.
On Aug 12, 2015, at 7:41 PM, Silvio Frischknecht <silvio.frischi at gmail.com> wrote:
> Btw I think I found a solution in
> there is a type level sort
> type family CmpSymbol m n :: Ordering
> This might work.
> Haskell-Cafe mailing list
> Haskell-Cafe at haskell.org
More information about the Haskell-Cafe