[Haskell-cafe] Float instance of 'read'

Jules Bean jules at jellybean.co.uk
Tue Sep 16 17:38:34 EDT 2008


Mauricio wrote:
> Do you think 'read' (actually,
> 'readsPrec'?) could be made to also
> read the international convention
> (ie., read "1,5" would also work
> besides read "1.5")? I'm happy to
> finaly use a language where I can
> use words of my language to name
> variables, so I wonder if we could
> also make that step.

The purpose of 'read' is to read haskell notation, not to read 
locally-sensitive notation.

So the right question to ask is "should we change haskell's lexical 
syntax to support locally-sensitive number notation".

IMO, the answer is no.

(1,3) would start to mean (13/10) and we'd need another notational rule 
(whitespace around commas) for numeric tuples. Feels like a painful 
special case to me.

Jules


More information about the Haskell-Cafe mailing list