unsafely 0.1.0.0.1 → 0.2.0.0
raw patch · 3 files changed
+12/−8 lines, 3 filesdep ~base
Dependency ranges changed: base
Files
examples/safe-unsafe.hs view
@@ -1,4 +1,5 @@ {-# LANGUAGE FlexibleContexts, FlexibleInstances, UndecidableInstances #-}+{-# LANGUAGE RankNTypes #-} module Main where import Data.Constraint.Unsafely import Data.IORef
src/Data/Constraint/Unsafely/Really.hs view
@@ -1,5 +1,5 @@-{-# LANGUAGE FlexibleContexts, FlexibleInstances, PolyKinds, RankNTypes #-}-{-# LANGUAGE ScopedTypeVariables, UndecidableInstances #-}+{-# LANGUAGE FlexibleInstances, PolyKinds, RankNTypes #-}+{-# LANGUAGE ScopedTypeVariables, UndecidableInstances #-} -- | Really unsafe module to provide internal interface. -- This module should be imported if you wish to allow the unsafe computation globally. --@@ -8,7 +8,6 @@ module Data.Constraint.Unsafely.Really ( ReallyUnsafely, Unsafely, unsafely ) where-import Data.Proxy import Unsafe.Coerce -- | The trick type-class to prevent providing global instances for @Unsafely@.@@ -30,5 +29,5 @@ newtype Thingy t a = Thingy (Unsafely t => a) -- | Evaluate the value which might be unsafe.-unsafely :: forall t a. Proxy t -> (Unsafely t => a) -> a+unsafely :: forall proxy t a. proxy t -> (Unsafely t => a) -> a unsafely _ f = unsafeCoerce (Thingy f :: Thingy t a) Impossible
unsafely.cabal view
@@ -1,5 +1,5 @@ name: unsafely-version: 0.1.0.0.1+version: 0.2.0.0 synopsis: Flexible access control for unsafe operations and instances description: This module aims at providing simple interface to control the acccess for /unsafe/ operations and instance.@@ -29,7 +29,7 @@ library exposed-modules: Data.Constraint.Unsafely, Data.Constraint.Unsafely.Really other-extensions: FlexibleContexts, FlexibleInstances, RankNTypes, ScopedTypeVariables, UndecidableInstances- build-depends: base >=4.6 && <4.7, tagged >=0.6 && <0.7+ build-depends: base >=4.6 && <4.8 hs-source-dirs: src default-language: Haskell2010 @@ -38,7 +38,9 @@ buildable: True else buildable: False- build-depends: base >=4.6 && <4.7, tagged >=0.6 && <0.7, unsafely+ build-depends: base >=4.6 && <4.8, unsafely+ if impl(ghc < 7.8)+ build-depends: tagged >=0.6 && <0.7 hs-source-dirs: examples main-is: semigroup.hs default-language: Haskell2010@@ -48,7 +50,9 @@ buildable: True else buildable: False- build-depends: base >=4.6 && <4.7, tagged >=0.6 && <0.7, unsafely+ build-depends: base >=4.6 && <4.8, unsafely+ if impl(ghc < 7.8)+ build-depends: tagged >=0.6 && <0.7 hs-source-dirs: examples main-is: safe-unsafe.hs default-language: Haskell2010