haskell-hvr / uuid

A Haskell library for creating, printing and parsing UUIDs
http://hackage.haskell.org/package/uuid
61 stars 38 forks source link

Provide a QuasiQuoter for UUID literals #41

Open jessekempf opened 6 years ago

jessekempf commented 6 years ago

@hvr: Can this be merged?

hvr commented 6 years ago

@jessekempf To be honest I'm not a fan of supporting string-literals which cannot be statically validated at compile time and would thus be runtime landmines. I'm rather considering offering a QuasiQuoter instead.

jessekempf commented 6 years ago

@hvr: By your command.

aslatter commented 6 years ago

Not sure how relevant this is, but there is a quasi-quoter over in https://hackage.haskell.org/package/uuid-quasi-0.1.0.1/docs/Data-UUID-Quasi.html

It is also relying on view patterns, however, which might be a down-side.

hvr commented 6 years ago

@aslatter where do you see ViewPatterns used? And why would that be undesirable?

aslatter commented 6 years ago

Sorry, I mis-remembered - the uuid-quasi package doesn't itself use ViewPatterns, but relies on ViewPatterns being enabled by the consumer if they want to use the pattern-match. If the quasi-quoter were in the uuid package itself that probably wouldn't be needed?