Skip to content

Instantly share code, notes, and snippets.

@sergv
Last active August 4, 2020 07:40
Show Gist options
  • Save sergv/b39d88500f68987046d06ca1ee54ffd0 to your computer and use it in GitHub Desktop.
Save sergv/b39d88500f68987046d06ca1ee54ffd0 to your computer and use it in GitHub Desktop.
Stack bug report with preprocessed file
import Distribution.Simple (defaultMainWithHooks)
import Distribution.Simple.UUAGC (uuagcLibUserHook)
import UU.UUAGC (uuagc)
main :: IO ()
main = defaultMainWithHooks $
uuagcLibUserHook uuagc
name:
stack-bug-report
version:
0.1.0.0
license:
BSD3
cabal-version:
>= 1.16
build-type: Custom
extra-source-files:
Test.ag
custom-setup
setup-depends:
base >= 4.7,
Cabal >= 1.16,
uuagc,
uuagc-cabal
library
exposed-modules:
Test
hs-source-dirs:
.
build-depends:
base >= 4.7
default-language:
Haskell2010
ghc-options:
-Wall
resolver: lts-11.0
packages:
- "."
extra-deps:
- uuagc-0.9.52.1
- uuagc-cabal-1.1.0.0
- uulib-0.9.23
module {Test}
{
-- exports
module Test
}
{
-- imports
}
data Tree
| Node left :: Tree
right :: Tree
| Tip value :: Int
attr Tree
syn sum :: Int
sem Tree
| Node lhs.sum = @left.sum + @right.sum
| Tip lhs.sum = @value
{
testTree :: Tree
testTree = Node (Tip 1) (Node (Tip 2) (Tip 3))
test :: Int
test = sem_Tree testTree
}
-- The file that defines the ADT(s)
file : "Test.ag"
options :
haskellsyntax,
-- The data option exists because we want UUAGC to actually generate
-- a data definition from that description
data,
-- Optional: all fields in the data definition(s) are strict
strictdata,
-- The following two options have the compiler generate functions to access
-- the attributes from the outside
catas,
semfuns,
wrappers,
-- generate signatures for semantic functions
signatures,
-- optimize generated code
optimize,
pretty
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment