[Haskell-cafe] Binary constants in Haskell

Claus Reinke claus.reinke at talk21.com
Thu Oct 25 12:29:28 EDT 2007


>> >  From my point of view, the difference between 0b10111011 and
>> > (bin[1,0,1,1,1,0,1,1]) is 22-10 that is 12 characters.

how about using ghc's new overloaded strings for this?

    "10111011"::Binary

there used to be a way to link to ghc head's docs, but 
i can't find it right now. the test is 

http://darcs.haskell.org/testsuite/tests/ghc-regress/typecheck/should_compile/tc224.hs

and the xml docs would be

http://darcs.haskell.org/ghc/docs/users_guide/glasgow_exts.xml

claus




More information about the Haskell-Cafe mailing list