[Haskell-cafe] types and braces

Conor McBride conor at strictlypositive.org
Wed Apr 15 10:10:17 EDT 2009


Hi folks

In search of displacement activity, I'm trying to tweak
Language.Haskell.Exts to support a few more perfidious
Exts I have in mind -- they only need a preprocessor,
but I do need to work on parsed programs, ideally.

I was hoping to add a production to the grammar of types
to admit expressions, delimited by braces:

   { exp }

The idea is that instead of writing, (er, hi Claus),

data True
data False

one just re-uses yer actual Bool (which becomes kind
{Bool}) and writes {True} or {False}.

The trouble is, the production I've added causes a
reduce/reduce conflict in the grammar, but I don't get
any more precise complaint than that.

I guess what I'd like to know is whether I just need to
debug my grammar extension, or whether the notation I'm
proposing actually introduces a serious ambiguity that
I'm too dim to notice. I'm mostly sending this in the
hope that I have one of those "d'oh" moments you
sometimes get when you articulate a stupid question in
public.

Put me out of my misery, please...

Cheers

Conor



More information about the Haskell-Cafe mailing list