4

I know it is possible with Haskell to pass values in octal with 0o777 and Hexadecimal with 0x1FF but:

Is it possible to pass a value in binary with Haskell?

1 Answer 1

6

Yes, with the {-# LANGUAGE BinaryLiterals #-} extension, as 0b01101. See here for some more details.

Sign up to request clarification or add additional context in comments.

2 Comments

I really hope that extension gets in the next Haskell Report. It's obviously a good idea.
To enable in ghci, add :set -XBinaryLiterals in your ~/.ghci config

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.