compound-types 0.1.3 → 0.1.3.1
raw patch · 3 files changed
+17/−18 lines, 3 filesdep −rebasedep ~base-preludePVP ok
version bump matches the API change (PVP)
Dependencies removed: rebase
Dependency ranges changed: base-prelude
API changes (from Hackage documentation)
Files
- compound-types.cabal +2/−4
- demo/Main.hs +15/−4
- library/CompoundTypes/Private/Prelude.hs +0/−10
compound-types.cabal view
@@ -1,7 +1,7 @@ name: compound-types version:- 0.1.3+ 0.1.3.1 category: Data, Types, Type System synopsis:@@ -50,7 +50,6 @@ default-language: Haskell2010 other-modules:- CompoundTypes.Private.Prelude CompoundTypes.Private.Strict.Sum CompoundTypes.Private.Strict.Product CompoundTypes.Private.Lazy.Sum@@ -60,7 +59,6 @@ CompoundTypes.Lazy build-depends: -- general:- base-prelude < 2, base >= 4.7 && < 4.10 @@ -82,4 +80,4 @@ Haskell2010 build-depends: compound-types,- rebase >= 1 && < 2+ base-prelude >= 1 && < 2
demo/Main.hs view
@@ -1,6 +1,6 @@ module Main where -import Rebase.Prelude+import BasePrelude import CompoundTypes.Strict @@ -12,7 +12,7 @@ -- being usable as a function parameter. -- -- It also shows, how we can pattern-match it.-intCharBoolSumToString :: Int + Char + Bool -> String+intCharBoolSumToString :: (Int + Char + Bool) -> String intCharBoolSumToString = \case Sum3_1 int -> "Int: " <> show int@@ -23,8 +23,19 @@ -- Following is an example of a more complicated composition, -- which is the same as the following type: -- --- > Sum3 Int (Product2 Char (Sum2 Bool String)) Char+-- > Sum3 Int (Product2 Char (Sum2 Bool Double)) Char -- -- Just as in the math, the product operator exhibits a higher priority. type SumAndProductMixture =- Int + Char * (Bool + String) + Char+ Int + Char * (Bool + Double) + Char++-- |+-- Where there is a multiplication and addition,+-- there naturally must be a division and subtraction!+-- +-- Following is an example of how we can extract parts of a composite type.+-- Here the type becomes the same as the following:+-- +-- > Bool + Double+type BoolOrDouble =+ (SumAndProductMixture - Int - Char) / Char
− library/CompoundTypes/Private/Prelude.hs
@@ -1,10 +0,0 @@-module CompoundTypes.Private.Prelude-(- module Exports,-)-where----- base-prelude---------------------------import BasePrelude as Exports