nikita-volkov / record-preprocessor

Compiler preprocessor introducing a syntactic extension for anonymous records
http://hackage.haskell.org/package/record-preprocessor
MIT License
12 stars 1 forks source link

Unsupported syntax #1

Open Quantumplation opened 9 years ago

Quantumplation commented 9 years ago

Hello again!

Hope I'm not getting annoying, just trying to help you track down any bugs in this before you release it proper.

I found several things that the record-preparser or record-syntax libraries did not like.

type Drop =
    {!
        location :: String,
        type     :: String, -- The drop type, one of: folder, remote
        url      :: String
    }
05:42:04 {master} /c/proj/record-preprocessor-demo$ cabal build
Building record-preprocessor-demo-0.1.0.0...
Preprocessing executable 'record-preprocessor-demo' for
record-preprocessor-demo-0.1.0.0...
[1 of 1] Compiling Main             ( record-preprocessor-demo\Main.hs, dist\build\record-preprocessor-demo\record-preprocessor-demo-tmp\Main.o )

C:\Users\djl434\AppData\Local\Temp\2\ghc18892_0\ghc18892_1.hspp:9:25:
    Illegal literal in type (use DataKinds to enable): "birthday"
05:42:47 {master} /c/proj/record-preprocessor-demo$

UPDATE: Also just ran into this issue:

{-
type Message =
    {!
      text :: String,
      html :: String,
      markdown :: String
    }
-}

causes:

05:59:00 {master} /c/proj/TfsAnnouncer$ cabal build
Building TfsAnnouncer-0.1.0.0...
Preprocessing executable 'TfsAnnouncer' for TfsAnnouncer-0.1.0.0...
record-preprocessor: library\Record\Syntax\Prelude.hs:(62,68)-(63,46): Non-exhaustive patterns in case

If I find any other problems, I'll post them here.

Regards, Pi Lanningham

Quantumplation commented 9 years ago

I managed to solve the Illegal type literal issue by including DataKinds in my cabal file, but I also had to include "NoImplicitPrelude". Both of these are fine for me, but you should probably document that in the demo project.

nikita-volkov commented 9 years ago

Thank you. Please keep posting, this is a very useful info.