foundation 0.0.17 → 0.0.18
raw patch · 17 files changed
+37/−28 lines, 17 filesdep ~basementdep ~gaugePVP: major bump suggested
API removals or changes: PVP suggests a major version bump
Dependency ranges changed: basement, gauge
API changes (from Hackage documentation)
- Foundation: data Proxy k (t :: k) :: forall k. k -> *
+ Foundation: data Proxy k (t :: k) :: forall k. () => k -> *
+ Foundation: infixl 3 <|>
+ Foundation: infixr 9 .
+ Foundation: liftA2 :: Applicative f => (a -> b -> c) -> f a -> f b -> f c
+ Foundation.Parser: infixl 3 <|>
- Foundation: ($!) :: (a -> b) -> a -> b
+ Foundation: ($!) :: () => (a -> b) -> a -> b
- Foundation: ($) :: (a -> b) -> a -> b
+ Foundation: ($) :: () => (a -> b) -> a -> b
- Foundation: (.) :: Category k cat => forall (b :: k) (c :: k) (a :: k). cat b c -> cat a b -> cat a c
+ Foundation: (.) :: Category k cat => forall (b :: k) (c :: k) (a :: k). () => cat b c -> cat a b -> cat a c
- Foundation: (<|>) :: Alternative f => forall a. f a -> f a -> f a
+ Foundation: (<|>) :: Alternative f => forall a. () => f a -> f a -> f a
- Foundation: asProxyTypeOf :: a -> Proxy * a -> a
+ Foundation: asProxyTypeOf :: () => a -> proxy a -> a
- Foundation: asTypeOf :: a -> a -> a
+ Foundation: asTypeOf :: () => a -> a -> a
- Foundation: catMaybes :: [Maybe a] -> [a]
+ Foundation: catMaybes :: () => [Maybe a] -> [a]
- Foundation: class (IsList c, Item c ~ Element c) => Collection c where elem e col = not $ e `notElem` col notElem e col = not $ e `elem` col
+ Foundation: class (IsList c, Item c ~ Element c) => Collection c
- Foundation: class Foldable collection where foldr' f z0 xs = foldl' f' id xs z0 where f' k x z = k $! f x z
+ Foundation: class Foldable collection
- Foundation: class Fstable a where type ProductFirst a where {
+ Foundation: class Fstable a where {
- Foundation: class IsList l where type Item l :: * where {
+ Foundation: class IsList l where {
- Foundation: class (IsList c, Item c ~ Element c, Monoid c, Collection c) => Sequential c where take n = fst . splitAt n revTake n = fst . revSplitAt n drop n = snd . splitAt n revDrop n = snd . revSplitAt n splitAt n c = (take n c, drop n c) revSplitAt n c = (revTake n c, revDrop n c) break predicate = span (not . predicate) breakEnd predicate = spanEnd (not . predicate) breakElem c = break (== c) takeWhile predicate = fst . span predicate dropWhile predicate = snd . span predicate intercalate xs xss = mconcatCollection (intersperse xs xss) span predicate = break (not . predicate) spanEnd predicate = breakEnd (not . predicate) partition predicate c = (filter predicate c, filter (not . predicate) c) head nel = maybe (error "head") fst $ uncons (getNonEmpty nel) last nel = maybe (error "last") snd $ unsnoc (getNonEmpty nel) tail nel = maybe (error "tail") snd $ uncons (getNonEmpty nel) init nel = maybe (error "init") fst $ unsnoc (getNonEmpty nel) isPrefixOf c1 c2 | len1 > len2 = False | len1 == len2 = c1 == c2 | otherwise = c1 == take len1 c2 where len1 = length c1 len2 = length c2 isSuffixOf c1 c2 | len1 > len2 = False | len1 == len2 = c1 == c2 | otherwise = c1 == revTake len1 c2 where len1 = length c1 len2 = length c2 isInfixOf c1 c2 = loop (len2 - len1) c2 where len1 = length c1 len2 = length c2 loop (Just cnt) c2' = c1 == take len1 c2' || loop (cnt - 1) (drop 1 c2') loop Nothing _ = False stripPrefix pre s | isPrefixOf pre s = Just $ drop (length pre) s | otherwise = Nothing stripSuffix suf s | isSuffixOf suf s = Just $ revDrop (length suf) s | otherwise = Nothing
+ Foundation: class (IsList c, Item c ~ Element c, Monoid c, Collection c) => Sequential c
- Foundation: class Sndable a where type ProductSecond a where {
+ Foundation: class Sndable a where {
- Foundation: class Subtractive a where type Difference a :: * where {
+ Foundation: class Subtractive a where {
- Foundation: class Thdable a where type ProductThird a where {
+ Foundation: class Thdable a where {
- Foundation: const :: a -> b -> a
+ Foundation: const :: () => a -> b -> a
- Foundation: curry :: ((a, b) -> c) -> a -> b -> c
+ Foundation: curry :: () => ((a, b) -> c) -> a -> b -> c
- Foundation: either :: (a -> c) -> (b -> c) -> Either a b -> c
+ Foundation: either :: () => (a -> c) -> (b -> c) -> Either a b -> c
- Foundation: flip :: (a -> b -> c) -> b -> a -> c
+ Foundation: flip :: () => (a -> b -> c) -> b -> a -> c
- Foundation: fromMaybe :: a -> Maybe a -> a
+ Foundation: fromMaybe :: () => a -> Maybe a -> a
- Foundation: id :: Category k cat => forall (a :: k). cat a a
+ Foundation: id :: Category k cat => forall (a :: k). () => cat a a
- Foundation: ifThenElse :: Bool -> a -> a -> a
+ Foundation: ifThenElse :: () => Bool -> a -> a -> a
- Foundation: isJust :: Maybe a -> Bool
+ Foundation: isJust :: () => Maybe a -> Bool
- Foundation: isNothing :: Maybe a -> Bool
+ Foundation: isNothing :: () => Maybe a -> Bool
- Foundation: lefts :: [Either a b] -> [a]
+ Foundation: lefts :: () => [Either a b] -> [a]
- Foundation: listToMaybe :: [a] -> Maybe a
+ Foundation: listToMaybe :: () => [a] -> Maybe a
- Foundation: mapMaybe :: (a -> Maybe b) -> [a] -> [b]
+ Foundation: mapMaybe :: () => (a -> Maybe b) -> [a] -> [b]
- Foundation: maybe :: b -> (a -> b) -> Maybe a -> b
+ Foundation: maybe :: () => b -> (a -> b) -> Maybe a -> b
- Foundation: maybeToList :: Maybe a -> [a]
+ Foundation: maybeToList :: () => Maybe a -> [a]
- Foundation: on :: (b -> b -> c) -> (a -> b) -> a -> a -> c
+ Foundation: on :: () => (b -> b -> c) -> (a -> b) -> a -> a -> c
- Foundation: partitionEithers :: [Either a b] -> ([a], [b])
+ Foundation: partitionEithers :: () => [Either a b] -> ([a], [b])
- Foundation: rights :: [Either a b] -> [b]
+ Foundation: rights :: () => [Either a b] -> [b]
- Foundation: seq :: a -> b -> b
+ Foundation: seq :: () => a -> b -> b
- Foundation: swap :: (a, b) -> (b, a)
+ Foundation: swap :: () => (a, b) -> (b, a)
- Foundation: uncurry :: (a -> b -> c) -> (a, b) -> c
+ Foundation: uncurry :: () => (a -> b -> c) -> (a, b) -> c
- Foundation: until :: (a -> Bool) -> (a -> a) -> a -> a
+ Foundation: until :: () => (a -> Bool) -> (a -> a) -> a -> a
- Foundation.Array.Internal: UArray :: {-# UNPACK #-} ~(Offset ty) -> {-# UNPACK #-} ~(CountOf ty) -> ~(UArrayBackend ty) -> UArray ty
+ Foundation.Array.Internal: UArray :: {-# UNPACK #-} !Offset ty -> {-# UNPACK #-} !CountOf ty -> !UArrayBackend ty -> UArray ty
- Foundation.Array.Internal: new :: (PrimMonad prim, PrimType ty) => CountOf ty -> prim (MUArray ty (PrimState prim))
+ Foundation.Array.Internal: new :: (PrimMonad prim, PrimType ty) => CountOf ty -> prim MUArray ty PrimState prim
- Foundation.Array.Internal: newPinned :: (PrimMonad prim, PrimType ty) => CountOf ty -> prim (MUArray ty (PrimState prim))
+ Foundation.Array.Internal: newPinned :: (PrimMonad prim, PrimType ty) => CountOf ty -> prim MUArray ty PrimState prim
- Foundation.Array.Internal: withMutablePtr :: (PrimMonad prim, PrimType ty) => MUArray ty (PrimState prim) -> (Ptr ty -> prim a) -> prim a
+ Foundation.Array.Internal: withMutablePtr :: (PrimMonad prim, PrimType ty) => MUArray ty PrimState prim -> (Ptr ty -> prim a) -> prim a
- Foundation.Class.Storable: castPtr :: Ptr a -> Ptr b
+ Foundation.Class.Storable: castPtr :: () => Ptr a -> Ptr b
- Foundation.Collection: Builder :: State (Offset step, BuildingState collection mutCollection step (PrimState state), Maybe err) state a -> Builder collection step err a
+ Foundation.Collection: Builder :: State (Offset step, BuildingState collection mutCollection step PrimState state, Maybe err) state a -> Builder collection step err a
- Foundation.Collection: BuildingState :: [collection] -> ~(CountOf step) -> mutCollection state -> ~(CountOf step) -> BuildingState collection step state
+ Foundation.Collection: BuildingState :: [collection] -> !CountOf step -> mutCollection state -> !CountOf step -> BuildingState collection step state
- Foundation.Collection: [chunkSize] :: BuildingState collection step state -> ~(CountOf step)
+ Foundation.Collection: [chunkSize] :: BuildingState collection step state -> !CountOf step
- Foundation.Collection: [prevChunksSize] :: BuildingState collection step state -> ~(CountOf step)
+ Foundation.Collection: [prevChunksSize] :: BuildingState collection step state -> !CountOf step
- Foundation.Collection: [runBuilder] :: Builder collection step err a -> State (Offset step, BuildingState collection mutCollection step (PrimState state), Maybe err) state a
+ Foundation.Collection: [runBuilder] :: Builder collection step err a -> State (Offset step, BuildingState collection mutCollection step PrimState state, Maybe err) state a
- Foundation.Collection: append :: (Buildable col, PrimMonad prim) => Element col -> Builder col (Mutable col) (Step col) prim err ()
+ Foundation.Collection: append :: (Buildable col, (PrimMonad prim)) => Element col -> Builder col (Mutable col) (Step col) prim err ()
- Foundation.Collection: build :: (Buildable col, PrimMonad prim) => Int -> Builder col (Mutable col) (Step col) prim err () -> prim (Either err col)
+ Foundation.Collection: build :: (Buildable col, (PrimMonad prim)) => Int -> Builder col (Mutable col) (Step col) prim err () -> prim (Either err col)
- Foundation.Collection: class Zippable col => BoxedZippable col where zip = zipWith (,) zip3 = zipWith3 (,,) zip4 = zipWith4 (,,,) zip5 = zipWith5 (,,,,) zip6 = zipWith6 (,,,,,) zip7 = zipWith7 (,,,,,,) unzip = go . toList where go [] = (mempty, mempty) go ((a, b) : xs) = let (as, bs) = go xs in (a `cons` as, b `cons` bs) unzip3 = go . toList where go [] = (mempty, mempty, mempty) go ((a, b, c) : xs) = let (as, bs, cs) = go xs in (a `cons` as, b `cons` bs, c `cons` cs) unzip4 = go . toList where go [] = (mempty, mempty, mempty, mempty) go ((a, b, c, d) : xs) = let (as, bs, cs, ds) = go xs in (a `cons` as, b `cons` bs, c `cons` cs, d `cons` ds) unzip5 = go . toList where go [] = (mempty, mempty, mempty, mempty, mempty) go ((a, b, c, d, e) : xs) = let (as, bs, cs, ds, es) = go xs in (a `cons` as, b `cons` bs, c `cons` cs, d `cons` ds, e `cons` es) unzip6 = go . toList where go [] = (mempty, mempty, mempty, mempty, mempty, mempty) go ((a, b, c, d, e, f) : xs) = let (as, bs, cs, ds, es, fs) = go xs in (a `cons` as, b `cons` bs, c `cons` cs, d `cons` ds, e `cons` es, f `cons` fs) unzip7 = go . toList where go [] = (mempty, mempty, mempty, mempty, mempty, mempty, mempty) go ((a, b, c, d, e, f, g) : xs) = let (as, bs, cs, ds, es, fs, gs) = go xs in (a `cons` as, b `cons` bs, c `cons` cs, d `cons` ds, e `cons` es, f `cons` fs, g `cons` gs)
+ Foundation.Collection: class Zippable col => BoxedZippable col
- Foundation.Collection: class Buildable col where type Mutable col :: * -> * type Step col where {
+ Foundation.Collection: class Buildable col where {
- Foundation.Collection: class (IsList c, Item c ~ Element c) => Collection c where elem e col = not $ e `notElem` col notElem e col = not $ e `elem` col
+ Foundation.Collection: class (IsList c, Item c ~ Element c) => Collection c
- Foundation.Collection: class Foldable collection where foldr' f z0 xs = foldl' f' id xs z0 where f' k x z = k $! f x z
+ Foundation.Collection: class Foldable collection
- Foundation.Collection: class InnerFunctor c where imap = fmap
+ Foundation.Collection: class InnerFunctor c
- Foundation.Collection: class KeyedCollection c where type Key c type Value c where {
+ Foundation.Collection: class KeyedCollection c where {
- Foundation.Collection: class Functor collection => Mappable collection where traverse f = sequenceA . fmap f sequenceA = traverse id mapM = traverse sequence = sequenceA
+ Foundation.Collection: class Functor collection => Mappable collection
- Foundation.Collection: class MutableCollection c where type MutableFreezed c type MutableKey c type MutableValue c unsafeThaw = thaw unsafeFreeze = freeze where {
+ Foundation.Collection: class MutableCollection c where {
- Foundation.Collection: class (IsList c, Item c ~ Element c, Monoid c, Collection c) => Sequential c where take n = fst . splitAt n revTake n = fst . revSplitAt n drop n = snd . splitAt n revDrop n = snd . revSplitAt n splitAt n c = (take n c, drop n c) revSplitAt n c = (revTake n c, revDrop n c) break predicate = span (not . predicate) breakEnd predicate = spanEnd (not . predicate) breakElem c = break (== c) takeWhile predicate = fst . span predicate dropWhile predicate = snd . span predicate intercalate xs xss = mconcatCollection (intersperse xs xss) span predicate = break (not . predicate) spanEnd predicate = breakEnd (not . predicate) partition predicate c = (filter predicate c, filter (not . predicate) c) head nel = maybe (error "head") fst $ uncons (getNonEmpty nel) last nel = maybe (error "last") snd $ unsnoc (getNonEmpty nel) tail nel = maybe (error "tail") snd $ uncons (getNonEmpty nel) init nel = maybe (error "init") fst $ unsnoc (getNonEmpty nel) isPrefixOf c1 c2 | len1 > len2 = False | len1 == len2 = c1 == c2 | otherwise = c1 == take len1 c2 where len1 = length c1 len2 = length c2 isSuffixOf c1 c2 | len1 > len2 = False | len1 == len2 = c1 == c2 | otherwise = c1 == revTake len1 c2 where len1 = length c1 len2 = length c2 isInfixOf c1 c2 = loop (len2 - len1) c2 where len1 = length c1 len2 = length c2 loop (Just cnt) c2' = c1 == take len1 c2' || loop (cnt - 1) (drop 1 c2') loop Nothing _ = False stripPrefix pre s | isPrefixOf pre s = Just $ drop (length pre) s | otherwise = Nothing stripSuffix suf s | isSuffixOf suf s = Just $ revDrop (length suf) s | otherwise = Nothing
+ Foundation.Collection: class (IsList c, Item c ~ Element c, Monoid c, Collection c) => Sequential c
- Foundation.Collection: class Sequential col => Zippable col where zipWith f a b = go f (toList a, toList b) where go f' = maybe mempty (\ (x, xs) -> uncurry2 f' x `cons` go f' xs) . uncons2 zipWith3 f a b c = go f (toList a, toList b, toList c) where go f' = maybe mempty (\ (x, xs) -> uncurry3 f' x `cons` go f' xs) . uncons3 zipWith4 fn a b c d = go fn (toList a, toList b, toList c, toList d) where go f' = maybe mempty (\ (x, xs) -> uncurry4 f' x `cons` go f' xs) . uncons4 zipWith5 fn a b c d e = go fn (toList a, toList b, toList c, toList d, toList e) where go f' = maybe mempty (\ (x, xs) -> uncurry5 f' x `cons` go f' xs) . uncons5 zipWith6 fn a b c d e f = go fn (toList a, toList b, toList c, toList d, toList e, toList f) where go f' = maybe mempty (\ (x, xs) -> uncurry6 f' x `cons` go f' xs) . uncons6 zipWith7 fn a b c d e f g = go fn (toList a, toList b, toList c, toList d, toList e, toList f, toList g) where go f' = maybe mempty (\ (x, xs) -> uncurry7 f' x `cons` go f' xs) . uncons7
+ Foundation.Collection: class Sequential col => Zippable col
- Foundation.Collection: getNonEmpty :: NonEmpty a -> a
+ Foundation.Collection: getNonEmpty :: () => NonEmpty a -> a
- Foundation.Foreign: mutableForeignMem :: (PrimMonad prim, PrimType ty) => FinalPtr ty -> Int -> prim (MUArray ty (PrimState prim))
+ Foundation.Foreign: mutableForeignMem :: (PrimMonad prim, PrimType ty) => FinalPtr ty -> Int -> prim MUArray ty PrimState prim
- Foundation.Hashing: class Hasher st where hashMix16 w st = hashMix8 w2 $ hashMix8 w1 st where !w1 = integralDownsize (w `unsafeShiftR` 8) !w2 = integralDownsize w hashMix32 w st = hashMix8 w4 $ hashMix8 w3 $ hashMix8 w2 $ hashMix8 w1 st where !w1 = integralDownsize (w `unsafeShiftR` 24) !w2 = integralDownsize (w `unsafeShiftR` 16) !w3 = integralDownsize (w `unsafeShiftR` 8) !w4 = integralDownsize w hashMix64 w st = hashMix32 w2 $ hashMix32 w1 st where !w1 = integralDownsize (w `unsafeShiftR` 32) !w2 = integralDownsize w hashMixBytes ba st = foldl' (flip hashMix8) st (unsafeRecast ba)
+ Foundation.Hashing: class Hasher st
- Foundation.IO.Terminal: exitFailure :: IO a
+ Foundation.IO.Terminal: exitFailure :: () => IO a
- Foundation.IO.Terminal: exitSuccess :: IO a
+ Foundation.IO.Terminal: exitSuccess :: () => IO a
- Foundation.Monad: class Monad m => MonadFailure (m :: * -> *) where type Failure (m :: * -> *) :: * where {
+ Foundation.Monad: class Monad m => MonadFailure (m :: * -> *) where {
- Foundation.Monad.Reader: class Monad m => MonadReader m where type ReaderContext m where {
+ Foundation.Monad.Reader: class Monad m => MonadReader m where {
- Foundation.Monad.State: class Monad m => MonadState m where type State m where {
+ Foundation.Monad.State: class Monad m => MonadState m where {
- Foundation.Numerical: class Subtractive a where type Difference a :: * where {
+ Foundation.Numerical: class Subtractive a where {
- Foundation.Parser: (<|>) :: Alternative f => forall a. f a -> f a -> f a
+ Foundation.Parser: (<|>) :: Alternative f => forall a. () => f a -> f a -> f a
- Foundation.Parser: class (Sequential input, IndexedCollection input) => ParserSource input where type Chunk input where {
+ Foundation.Parser: class (Sequential input, IndexedCollection input) => ParserSource input where {
- Foundation.Parser: many :: Alternative f => forall a. f a -> f [a]
+ Foundation.Parser: many :: Alternative f => forall a. () => f a -> f [a]
- Foundation.Parser: optional :: Alternative f => f a -> f (Maybe a)
+ Foundation.Parser: optional :: Alternative f => f a -> f Maybe a
- Foundation.Parser: some :: Alternative f => forall a. f a -> f [a]
+ Foundation.Parser: some :: Alternative f => forall a. () => f a -> f [a]
- Foundation.Primitive: class (Functor m, Applicative m, Monad m) => PrimMonad (m :: * -> *) where type PrimState (m :: * -> *) :: * type PrimVar (m :: * -> *) :: * -> * where {
+ Foundation.Primitive: class (Functor m, Applicative m, Monad m) => PrimMonad (m :: * -> *) where {
- Foundation.Primitive: primMbaURead :: (PrimType ty, PrimMonad prim) => MutableByteArray# (PrimState prim) -> Offset ty -> prim ty
+ Foundation.Primitive: primMbaURead :: (PrimType ty, PrimMonad prim) => MutableByteArray# PrimState prim -> Offset ty -> prim ty
- Foundation.Primitive: primMbaUWrite :: (PrimType ty, PrimMonad prim) => MutableByteArray# (PrimState prim) -> Offset ty -> ty -> prim ()
+ Foundation.Primitive: primMbaUWrite :: (PrimType ty, PrimMonad prim) => MutableByteArray# PrimState prim -> Offset ty -> ty -> prim ()
- Foundation.Primitive: primVarNew :: PrimMonad m => a -> m (PrimVar m a)
+ Foundation.Primitive: primVarNew :: PrimMonad m => a -> m PrimVar m a
- Foundation.Primitive: primitive :: PrimMonad m => (State# (PrimState m) -> (# VoidRep, PtrRepLifted, State# (PrimState m), a #)) -> m a
+ Foundation.Primitive: primitive :: PrimMonad m => (State# PrimState m -> (# TupleRep [] RuntimeRep, LiftedRep, State# PrimState m, a #)) -> m a
- Foundation.Primitive: unPrimMonad :: PrimMonad m => m a -> State# (PrimState m) -> (# VoidRep, PtrRepLifted, State# (PrimState m), a #)
+ Foundation.Primitive: unPrimMonad :: PrimMonad m => m a -> State# PrimState m -> (# TupleRep [] RuntimeRep, LiftedRep, State# PrimState m, a #)
- Foundation.String.Read: readFloatingExact :: String -> ReadFloatingCallback a -> Maybe a
+ Foundation.String.Read: readFloatingExact :: () => String -> ReadFloatingCallback a -> Maybe a
- Foundation.Tuple.Nth: class KnownNat n => Nthable n a where type NthTy n a where {
+ Foundation.Tuple.Nth: class KnownNat n => Nthable n a where {
- Foundation.VFS: class Path path where type PathEnt path type PathPrefix path type PathSuffix path where {
+ Foundation.VFS: class Path path where {
- Foundation.VFS.Path: class Path path where type PathEnt path type PathPrefix path type PathSuffix path where {
+ Foundation.VFS.Path: class Path path where {
Files
- CHANGELOG.md +9/−0
- Foundation/Check/Arbitrary.hs +3/−1
- Foundation/Class/Storable.hs +1/−1
- Foundation/Foreign.hs +2/−2
- Foundation/Foreign/MemoryMap/Posix.hsc +1/−1
- Foundation/Network/HostName.hsc +1/−1
- Foundation/System/Bindings/Hs.hs +1/−1
- Foundation/System/Bindings/Linux.hsc +1/−1
- Foundation/System/Bindings/Macos.hsc +1/−1
- Foundation/System/Bindings/Network.hsc +1/−1
- Foundation/System/Bindings/Posix.hsc +1/−1
- Foundation/System/Bindings/PosixDef.hsc +1/−2
- Foundation/System/Bindings/Time.hsc +1/−1
- Foundation/System/Entropy/Unix.hs +1/−1
- Foundation/Time/StopWatch.hs +5/−5
- benchs/BenchUtil/Common.hs +2/−2
- foundation.cabal +5/−6
CHANGELOG.md view
@@ -1,3 +1,12 @@+## 0.0.18++* Add missing lowlevel Block functionality+* Cleanup UArray to use more functions from Block+* Push Xoroshiro down to basement+* Add instances for foundation's numerical classes for C types+* Update benchmarks to gauge 0.2.0+* Add documentation to some block & uarray functions+ ## 0.0.17 * Add Terminal capabilities: ANSI Escape, UTF8 codepage initialization, get dimensions
Foundation/Check/Arbitrary.hs view
@@ -184,7 +184,9 @@ elements l = frequency (nonEmptyFmap (\x -> (1, pure x)) l) between :: (Word, Word) -> Gen Word-between (x,y) = (+) x <$> genMax range+between (x,y)+ | range == 0 = pure x+ | otherwise = (+) x <$> genMax range where range = y - x genMax :: Word -> Gen Word
Foundation/Class/Storable.hs view
@@ -35,9 +35,9 @@ import Foreign.Ptr (castPtr) import qualified Foreign.Ptr import qualified Foreign.Storable (peek, poke)-import Foreign.C.Types (CChar, CUChar) import Basement.Compat.Base+import Basement.Compat.C.Types (CChar, CUChar) import Basement.Types.OffsetSize import Basement.Types.Word128 (Word128(..)) import Basement.Types.Word256 (Word256(..))
Foundation/Foreign.hs view
@@ -9,11 +9,11 @@ ( module Basement.FinalPtr , V.foreignMem , V.mutableForeignMem- , module Foreign.C.Types+ , module Basement.Compat.C.Types ) where import Basement.FinalPtr import qualified Basement.UArray as V import qualified Basement.UArray.Mutable as V -import Foreign.C.Types+import Basement.Compat.C.Types
Foundation/Foreign/MemoryMap/Posix.hsc view
@@ -42,10 +42,10 @@ ) where import Basement.Compat.Base+import Basement.Compat.C.Types import Basement.Types.OffsetSize import System.Posix.Types import Foreign.Ptr-import Foreign.C.Types import Foreign.C.Error import Data.Bits
Foundation/Network/HostName.hsc view
@@ -24,6 +24,7 @@ import Foundation.Class.Storable import Basement.Compat.Base+import Basement.Compat.C.Types import Data.Proxy import Foundation.Hashing (Hashable) import Foundation.String@@ -35,7 +36,6 @@ import Foundation.System.Bindings.Network import Foreign.C.String-import Foreign.C.Types import Foreign.Ptr (nullPtr) import Control.Concurrent.MVar import System.IO.Unsafe (unsafePerformIO)
Foundation/System/Bindings/Hs.hs view
@@ -5,6 +5,6 @@ where import GHC.IO-import Foreign.C.Types+import Basement.Compat.C.Types foreign import ccall unsafe "HsBase.h __hscore_get_errno" sysHsCoreGetErrno :: IO CInt
Foundation/System/Bindings/Linux.hsc view
@@ -16,7 +16,7 @@ where import Basement.Compat.Base-import Foreign.C.Types+import Basement.Compat.C.Types import Foundation.System.Bindings.PosixDef #define __USE_GNU
Foundation/System/Bindings/Macos.hsc view
@@ -3,7 +3,7 @@ where import Basement.Compat.Base-import Foreign.C.Types+import Basement.Compat.C.Types import Foundation.System.Bindings.PosixDef import Basement.Types.OffsetSize
Foundation/System/Bindings/Network.hsc view
@@ -16,7 +16,7 @@ ) where import Basement.Compat.Base-import Foreign.C.Types+import Basement.Compat.C.Types #ifdef mingw32_HOST_OS # include <winsock2.h>
Foundation/System/Bindings/Posix.hsc view
@@ -17,7 +17,7 @@ where import Basement.Compat.Base-import Foreign.C.Types+import Basement.Compat.C.Types import Data.Bits import Foundation.System.Bindings.PosixDef
Foundation/System/Bindings/PosixDef.hsc view
@@ -12,8 +12,7 @@ , CMode(..) ) where -import Foreign.C.Types-import System.Posix.Types (COff(..), CMode(..))+import Basement.Compat.C.Types type CErrno = CInt type CFd = CInt
Foundation/System/Bindings/Time.hsc view
@@ -6,8 +6,8 @@ module Foundation.System.Bindings.Time where import Basement.Compat.Base+import Basement.Compat.C.Types import Basement.Types.OffsetSize-import Foreign.C.Types #include <time.h> #include <sys/time.h>
Foundation/System/Entropy/Unix.hs view
@@ -16,12 +16,12 @@ ) where import Foreign.Ptr-import Foreign.C.Types import Control.Exception as E import Control.Monad import System.IO import System.IO.Unsafe (unsafePerformIO) import Basement.Compat.Base+import Basement.Compat.C.Types import Prelude (fromIntegral) import Foundation.System.Entropy.Common import Foundation.Numerical
Foundation/Time/StopWatch.hs view
@@ -53,7 +53,7 @@ initPrecise :: (Word64, Word64) initPrecise = unsafePerformIO $ do mti <- newPinned (sizeOfCSize size_MachTimebaseInfo)- mutableWithPtr mti $ \p -> do+ withMutablePtr mti $ \p -> do sysMacos_timebase_info (castPtr p) let p32 = castPtr p :: Ptr Word32 !n <- peek (p32 `ptrPlus` ofs_MachTimebaseInfo_numer)@@ -69,14 +69,14 @@ startPrecise = do #if defined(mingw32_HOST_OS) blk <- newPinned 16- _ <- mutableWithPtr blk $ \p ->+ _ <- withMutablePtr blk $ \p -> c_QueryPerformanceCounter (castPtr p `ptrPlus` 8) pure (StopWatchPrecise blk) #elif defined(darwin_HOST_OS) StopWatchPrecise <$> sysMacos_absolute_time #else blk <- newPinned (sizeOfCSize (size_CTimeSpec + size_CTimeSpec))- _err1 <- mutableWithPtr blk $ \p -> do+ _err1 <- withMutablePtr blk $ \p -> do sysTimeClockGetTime sysTime_CLOCK_MONOTONIC (castPtr p `ptrPlusCSz` size_CTimeSpec) pure (StopWatchPrecise blk) #endif@@ -85,7 +85,7 @@ stopPrecise :: StopWatchPrecise -> IO NanoSeconds stopPrecise (StopWatchPrecise blk) = do #if defined(mingw32_HOST_OS)- mutableWithPtr blk $ \p -> do+ withMutablePtr blk $ \p -> do _ <- c_QueryPerformanceCounter (castPtr p) let p64 = castPtr p :: Ptr Word64 end <- peek p64@@ -97,7 +97,7 @@ (1,1) -> end - blk (numer,denom) -> ((end - blk) * numer) `div` denom #else- mutableWithPtr blk $ \p -> do+ withMutablePtr blk $ \p -> do _err1 <- sysTimeClockGetTime sysTime_CLOCK_MONOTONIC (castPtr p) let p64 = castPtr p :: Ptr Word64 endSec <- peek p64
benchs/BenchUtil/Common.hs view
@@ -12,8 +12,8 @@ , nf ) where -import Gauge.Main hiding (bgroup, bench)-import qualified Gauge.Main as C+import Gauge hiding (bgroup, bench)+import qualified Gauge as C import Foundation fbench = bench "foundation"
foundation.cabal view
@@ -1,5 +1,5 @@ name: foundation-version: 0.0.17+version: 0.0.18 synopsis: Alternative prelude with batteries and no dependencies description: A custom prelude with no dependencies apart from base.@@ -21,8 +21,7 @@ * Usual partial functions distinguished through type system license: BSD3 license-file: LICENSE-copyright: 2015-2017 Vincent Hanquez <vincent@snarc.org>- 2017 Foundation Maintainers+copyright: 2015-2017 Vincent Hanquez <vincent@snarc.org>, 2017- Foundation Maintainers author: Vincent Hanquez <vincent@snarc.org> maintainer: vincent@snarc.org category: foundation@@ -37,7 +36,7 @@ source-repository head type: git- location: https://github.com/haskell-foundation/foundation.git+ location: https://github.com/haskell-foundation/foundation flag experimental description: Enable building experimental features, known as highly unstable or without good support cross-platform@@ -192,7 +191,7 @@ BangPatterns DeriveDataTypeable build-depends: base >= 4.7 && < 5- , basement == 0.0.4+ , basement == 0.0.5 , ghc-prim -- FIXME add suport for armel mipsel -- CPP-options: -DARCH_IS_LITTLE_ENDIAN@@ -274,7 +273,7 @@ if flag(minimal-deps) || impl(ghc < 7.10) buildable: False else- build-depends: base >= 4, gauge, basement, foundation+ build-depends: base >= 4, gauge >= 0.2.0, basement, foundation if flag(bench-all) cpp-options: -DBENCH_ALL build-depends: text, attoparsec, vector, bytestring