singleton-bool 0.1.3 → 0.1.4
raw patch · 3 files changed
+28/−2 lines, 3 filesdep ~base
Dependency ranges changed: base
Files
- CHANGELOG.md +3/−0
- singleton-bool.cabal +2/−2
- src/Data/Singletons/Bool.hs +23/−0
CHANGELOG.md view
@@ -1,3 +1,6 @@+- 0.1.4+ - Add `fromSBool` and `withSomeSBool`.+ - 0.1.3.0 - Add `reifyBool` and `reflectBool`. - Drop GHC-7.4 support (broken `PolyKinds`)
singleton-bool.cabal view
@@ -1,5 +1,5 @@ name: singleton-bool-version: 0.1.3+version: 0.1.4 synopsis: Type level booleans description: Type level booleans. .@@ -35,7 +35,7 @@ src ghc-options: -Wall build-depends:- base >=4.6 && <4.11+ base >=4.6 && <4.12 exposed-modules: Data.Singletons.Bool default-language: Haskell2010
src/Data/Singletons/Bool.hs view
@@ -16,6 +16,8 @@ module Data.Singletons.Bool ( SBool(..), SBoolI(..),+ fromSBool,+ withSomeSBool, reflectBool, reifyBool, -- * Data.Type.Bool and .Equality@@ -42,6 +44,27 @@ class SBoolI (b :: Bool) where sbool :: SBool b instance SBoolI 'True where sbool = STrue instance SBoolI 'False where sbool = SFalse++-------------------------------------------------------------------------------+-- conversion to and from explicit SBool values+-------------------------------------------------------------------------------++-- | Convert an 'SBool' to the corresponding 'Bool'.+--+-- @since next+fromSBool :: SBool b -> Bool+fromSBool STrue = True+fromSBool SFalse = False++-- | Convert a normal 'Bool' to an 'SBool', passing it into a continuation.+--+-- >>> withSomeSBool True fromSBool+-- True+--+-- @since next+withSomeSBool :: Bool -> (forall b. SBool b -> r) -> r+withSomeSBool True f = f STrue+withSomeSBool False f = f SFalse ------------------------------------------------------------------------------- -- reify & reflect