packages feed

futhask 1.0.0 → 1.1.0

raw patch · 4 files changed

+9/−9 lines, 4 files

Files

ChangeLog.md view
@@ -1,4 +1,3 @@ # Changelog for futhask--## Unreleased changes-Change in the name of the Monad from `FT` to `Fut`. This is a breaking change, but in principle a simple search and replace should fix it. The motivation for the change is both that it is more descriptive, and the introduction of the transformer. `FutT` simply looks better then `FTT`, especially in names using CamelCase. The original name `FT` was inspired by `ST`, since they both use rigid type variables for similar purposes.+## 1.1.0+fix bugs in sum type handling
app/Main.hs view
@@ -81,8 +81,8 @@     T.writeFile (natdir <> "Types.hs") $ nativeTypes     T.writeFile (unpdir <> "Types.hs") $ unpackedTypes     where-        futhaskVersion = "1.0.0.0"-        futhaskBaseVersion = "0.1.0.0"+        futhaskVersion = "1.1.0.0"+        futhaskBaseVersion = "0.2.0.0"         --name = "testlib"         --libver = "0.1"         --pacdir = "../testlibrary/"
futhask.cabal view
@@ -1,7 +1,7 @@ cabal-version: 1.12  name:           futhask-version:        1.0.0+version:        1.1.0 synopsis:       Generate Haskell wrappers for Futhark libraries description:    Please see the README on GitLab at <https://gitlab.com/Gusten_Isfeldt/futhask#futhask> category:       FFI Tools
src/CodeGen.hs view
@@ -160,7 +160,7 @@     "Tup" <> T.pack (show (length fields)) <-> T.intercalate "_" (map formatCompositeType fields) formatCompositeType (RecordType fields) =     "Rec" <> T.pack (show (length fields)) <-> T.intercalate "_" (map (\(n, t) -> T.pack n <-> formatCompositeType t) fields)-formatCompositeType (SumType variants) = "Sum" <> T.pack (show (length variants)) <-> T.intercalate "_" (map (\(c, ps) -> T.pack c <-> T.intercalate "_" (map formatCompositeType ps)) variants) +formatCompositeType (SumType variants) = "Sum" <> T.pack (show (length variants)) <-> T.intercalate "_" (map (\(c, ps) -> T.intercalate "_" (T.pack c : map formatCompositeType ps)) variants)   haskellEquivType :: CompositeType -> Text haskellEquivType (SimpleType t) = haskellType t@@ -203,9 +203,10 @@             >>= \m -> char '}' >> pure (RecordType m)         '[' -> P.munch (\c -> elem c ("[]" :: String)) >>= \p -> readCompositeType >>= \elem -> pure (ArrayType (div (length p + 1) 2) elem)          '#' -> P.sepBy -            (P.munch (/=' ') >>= \cons -> P.sepBy readCompositeType (P.char ' ') >>= \payloads -> pure (cons, payloads)) +            (P.munch (\c -> not $ elem c (" ,"::String)) >>= \cons -> P.sepBy readCompositeType (P.char ' ') >>= \payloads -> pure (cons, payloads))              (P.string " | #")-            >>= \cps -> pure (SumType cps) +            >>= \cps -> pure (SumType cps)+        ',' -> P.pfail         _   -> P.munch (\c -> not $ elem c (" ()[]{},#|"::String)) >>= \cs -> pure (SimpleType (T.pack (c:cs)))     where         char c = P.char c >>= \_ -> pure ()