packages feed

language-elm 0.1.1.0 → 0.1.1.1

raw patch · 9 files changed

+91/−5 lines, 9 filesdep ~base

Dependency ranges changed: base

Files

language-elm.cabal view
@@ -2,17 +2,17 @@ -- -- see: https://github.com/sol/hpack ----- hash: 051b4a8042d05f18fb64b3714184c09ca9363d68b341ec9be6effdb370eeabe0+-- hash: 04af5d2caaf43cc7d680a3326b8b2aed05a209f2d5a20cc360ea287ba6346f77  name:           language-elm-version:        0.1.1.0+version:        0.1.1.1 synopsis:       Generate elm code description:    Generate elm code from an ast category:       Web homepage:       https://github.com/eliaslfox/language-elm#readme bug-reports:    https://github.com/eliaslfox/language-elm/issues author:         Elias Lawson-Fox-maintainer:     eliaslfox@gmail.com+maintainer:     me@eliaslfox.com copyright:      2017 Elias Lawson-Fox license:        BSD3 license-file:   LICENSE@@ -20,6 +20,15 @@ cabal-version:  >= 1.10 extra-source-files:     README.md+data-files:+    test/program1.elm+    test/spec/case1.txt+    test/spec/dec1.txt+    test/spec/dec2.txt+    test/spec/dec3.txt+    test/spec/dec4.txt+    test/spec/let1.txt+    test/spec/let2.txt  source-repository head   type: git@@ -41,7 +50,7 @@       src   build-depends:       MissingH-    , base >=4.11 && <=4.12+    , base >=4.11 && <4.12     , mtl     , pretty     , protolude@@ -59,7 +68,7 @@       test   ghc-options: -threaded -rtsopts -with-rtsopts=-N   build-depends:-      base >=4.11 && <=4.12+      base >=4.11 && <4.12     , hspec     , language-elm     , mtl
+ test/program1.elm view
@@ -0,0 +1,46 @@+module Maybe exposing (Maybe(Just, Nothing), andThen, map, map2, map3, map4, map5, withDefault)+++type Maybe a+    = Nothing+    | Just a+++withDefault : a -> Maybe a -> a+withDefault default maybe =+    case maybe of+        Just value ->+            value++        Nothing ->+            default+++map : (a -> b) -> Maybe a -> Maybe b+map f maybe =+    case maybe of+        Just value ->+            Just (f value)++        Nothing ->+            Nothing+++map2 : (a -> b -> value) -> Maybe a -> Maybe b -> Maybe value+map2 func ma mb =+    case ( ma, mb ) of+        ( Just a, Just b ) ->+            Just (func a b)++        _ ->+            Nothing+++map3 : (a -> b -> c -> value) -> Maybe a -> Maybe b -> Maybe c -> Maybe value+map3 func ma mb mc =+    case ( ma, mb, mc ) of+        ( Just a, Just b, Just c ) ->+            Just (func a b c)++        _ ->+            Nothing
+ test/spec/case1.txt view
@@ -0,0 +1,6 @@+case m of+    Just x ->+        x++    Nothing ->+        0
+ test/spec/dec1.txt view
@@ -0,0 +1,3 @@+add5 : Int -> Int+add5 x =+    x + 5
+ test/spec/dec2.txt view
@@ -0,0 +1,8 @@+withDefault : a -> Maybe a -> a+withDefault default m =+    case m of+        Just x ->+            x++        Nothing ->+            default
+ test/spec/dec3.txt view
@@ -0,0 +1,3 @@+type Maybe a+    = Nothing+    | Just a
+ test/spec/dec4.txt view
@@ -0,0 +1,2 @@+type alias Model a =+    Maybe a
+ test/spec/let1.txt view
@@ -0,0 +1,4 @@+let+    a = 5+in+    a
+ test/spec/let2.txt view
@@ -0,0 +1,5 @@+let+    a = 5+    b = 6+in+    a + b