composite-tuple 0.1.1.0 → 0.1.2.0
raw patch · 3 files changed
+14/−4 lines, 3 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
+ Composite.Record.Tuple: pattern (:|:) :: a -> b -> Record ((s :-> a) : ((s' :-> b) : '[]))
Files
- ChangeLog.md +4/−0
- composite-tuple.cabal +1/−1
- src/Composite/Record/Tuple.hs +9/−3
ChangeLog.md view
@@ -1,5 +1,9 @@ # Changelog for composite-tuple +## (v0.1.2.0)++* Add `pattern (:|:)`.+ ## (v0.1.1.0) * Add `singleton`.
composite-tuple.cabal view
@@ -5,7 +5,7 @@ -- see: https://github.com/sol/hpack name: composite-tuple-version: 0.1.1.0+version: 0.1.2.0 synopsis: Tuple functions for composite records. description: Tuple functions for composite records. category: Data Structures
src/Composite/Record/Tuple.hs view
@@ -1,6 +1,7 @@-{-# LANGUAGE DataKinds #-}-{-# LANGUAGE GADTs #-}-{-# LANGUAGE TypeOperators #-}+{-# LANGUAGE DataKinds #-}+{-# LANGUAGE GADTs #-}+{-# LANGUAGE PatternSynonyms #-}+{-# LANGUAGE TypeOperators #-} {- | Module : Composite.Record.Tuple License : MIT@@ -10,6 +11,7 @@ -} module Composite.Record.Tuple ( singleton+, pattern (:|:) , toFst , toSnd , fmapToFst@@ -25,6 +27,10 @@ -- | Put a single value in a record. singleton :: a -> Record (s :-> a : '[]) singleton a = a :*: RNil++-- | Pattern for a pair in a record+pattern (:|:) :: a -> b -> Record (s :-> a : s' :-> b : '[])+pattern a :|: b = a :*: b :*: RNil -- | Apply a function, with the result in the fst slot, and the value in the other. toFst :: (a -> b) -> a -> Record (s :-> b : s' :-> a : '[])