ndmitchell: > Hi > > > The first case makes sense, and is just a RULE. Though it seems GHC already > > does this? > > > > g = head "" > > > > goes to: > > > > M.g = badHead @ Char > > > > without prompting. > > Nope, as far as I can tell "" gets translated to [], not > unpackCString# "" - hence the unpack never gets in the way. If you had > the second rule, you'd soon want the first. > > > So I wondered if I could write a rule for head/unpackCString > > > > Urgh. not what we want though. GHC won't index the string at compile time, > > and I can't write a RULE for it. > > Yeah, I tried that too... > > > Perhaps you can newtype Char and use string overloading to work around the > > packing issue? > > That would work on GHC, but not on Hugs.
Optimisation and Hugs don't go together anyway. -- Don _______________________________________________ Glasgow-haskell-users mailing list [email protected] http://www.haskell.org/mailman/listinfo/glasgow-haskell-users
