packages feed

foundation 0.0.21 → 0.0.22

raw patch · 7 files changed

+60/−6 lines, 7 filesdep ~basementPVP: major bump suggested

API removals or changes: PVP suggests a major version bump

Dependency ranges changed: basement

API changes (from Hackage documentation)

- Foundation.Parser: instance (Data.Typeable.Internal.Typeable input, GHC.Show.Show input) => GHC.Exception.Exception (Foundation.Parser.ParseError input)
- Foundation.VFS.FilePath: instance GHC.Exception.Exception Foundation.VFS.FilePath.FileName_Invalid
- Foundation.VFS.FilePath: instance GHC.Exception.Exception Foundation.VFS.FilePath.FilePath_Invalid
+ Foundation: -- structure <tt>l</tt>.
+ Foundation: -- | The <a>Item</a> type function returns the type of items of the
+ Foundation: infix 4 /=
+ Foundation: infixl 1 >>
+ Foundation: infixl 6 -
+ Foundation: infixl 7 /
+ Foundation.Bits: infixl 5 .|.
+ Foundation.Bits: infixl 6 `xor`
+ Foundation.Bits: infixl 7 .&.
+ Foundation.Bits: infixl 8 `rotateR`
+ Foundation.Collection: --
+ Foundation.Collection: -- A UTF-8 character can have a size between 1 and 4 bytes, so this
+ Foundation.Collection: -- should be defined as 1 byte for collections of <a>Char</a>.
+ Foundation.Collection: -- | Unit of the smallest step possible in an <a>append</a> operation.
+ Foundation.Monad: -- can be encoded in this monad
+ Foundation.Monad: -- | The associated type with the MonadFailure, representing what failure
+ Foundation.Numerical: infixl 6 -
+ Foundation.Numerical: infixl 7 /
+ Foundation.Numerical: infixr 8 ^
+ Foundation.Parser: instance (Data.Typeable.Internal.Typeable input, GHC.Show.Show input) => GHC.Exception.Type.Exception (Foundation.Parser.ParseError input)
+ Foundation.Primitive: -- | type of variable associated with the PrimMonad m
+ Foundation.VFS: --
+ Foundation.VFS: -- <a>Element</a> type family
+ Foundation.VFS: -- case of the <a>URI</a>, it is a the query, the fragment
+ Foundation.VFS: -- in the case of the <a>FilePath</a>, it is a void (i.e. `()`) in the
+ Foundation.VFS: -- it is possible to see this associated type equivalent to the
+ Foundation.VFS: -- minimal element contained in the Path a Path is not a collection but
+ Foundation.VFS: -- of a <a>URI</a>, it is the schema, host, port...
+ Foundation.VFS: -- | the associated suffix of the given path
+ Foundation.VFS.FilePath: instance GHC.Exception.Type.Exception Foundation.VFS.FilePath.FileName_Invalid
+ Foundation.VFS.FilePath: instance GHC.Exception.Type.Exception Foundation.VFS.FilePath.FilePath_Invalid
+ Foundation.VFS.Path: --
+ Foundation.VFS.Path: -- <a>Element</a> type family
+ Foundation.VFS.Path: -- case of the <a>URI</a>, it is a the query, the fragment
+ Foundation.VFS.Path: -- in the case of the <a>FilePath</a>, it is a void (i.e. `()`) in the
+ Foundation.VFS.Path: -- it is possible to see this associated type equivalent to the
+ Foundation.VFS.Path: -- minimal element contained in the Path a Path is not a collection but
+ Foundation.VFS.Path: -- of a <a>URI</a>, it is the schema, host, port...
+ Foundation.VFS.Path: -- | the associated suffix of the given path
- Foundation: ($!) :: () => a -> b -> a -> b
+ Foundation: ($!) :: () => (a -> b) -> a -> b
- Foundation: ($) :: () => a -> b -> a -> b
+ Foundation: ($) :: () => (a -> b) -> a -> b
- Foundation: (<$>) :: Functor f => a -> b -> f a -> f b
+ Foundation: (<$>) :: Functor f => (a -> b) -> f a -> f b
- Foundation: (<*>) :: Applicative f => f a -> b -> f a -> f b
+ Foundation: (<*>) :: Applicative f => f (a -> b) -> f a -> f b
- Foundation: (=<<) :: Monad m => a -> m b -> m a -> m b
+ Foundation: (=<<) :: Monad m => (a -> m b) -> m a -> m b
- Foundation: (>=>) :: Monad m => a -> m b -> b -> m c -> a -> m c
+ Foundation: (>=>) :: Monad m => (a -> m b) -> (b -> m c) -> a -> m c
- Foundation: (>>=) :: Monad m => m a -> a -> m b -> m b
+ Foundation: (>>=) :: Monad m => m a -> (a -> m b) -> m b
- Foundation: (^) :: (Multiplicative a, IsNatural n, IDivisible n) => a -> n -> a
+ Foundation: (^) :: (Multiplicative a, IsNatural n, Enum n, IDivisible n) => a -> n -> a
- Foundation: bimap :: Bifunctor p => a -> b -> c -> d -> p a c -> p b d
+ Foundation: bimap :: Bifunctor p => (a -> b) -> (c -> d) -> p a c -> p b d
- Foundation: class Functor f => Applicative (f :: * -> *)
+ Foundation: class Functor f => Applicative (f :: Type -> Type)
- Foundation: class Bifunctor (p :: * -> * -> *)
+ Foundation: class Bifunctor (p :: Type -> Type -> Type)
- Foundation: class Functor (f :: * -> *)
+ Foundation: class Functor (f :: Type -> Type)
- Foundation: class (Enum a, Eq a, Ord a, Integral a) => IsIntegral a
+ Foundation: class (Integral a, Eq a, Ord a) => IsIntegral a
- Foundation: class (Enum a, Eq a, Ord a, Integral a, IsIntegral a) => IsNatural a
+ Foundation: class IsIntegral a => IsNatural a
- Foundation: class Applicative m => Monad (m :: * -> *)
+ Foundation: class Applicative m => Monad (m :: Type -> Type)
- Foundation: curry :: () => (a, b) -> c -> a -> b -> c
+ Foundation: curry :: () => ((a, b) -> c) -> a -> b -> c
- Foundation: data Proxy (t :: k) :: forall k. () => k -> *
+ Foundation: data Proxy (t :: k) :: forall k. () => k -> Type
- Foundation: either :: () => a -> c -> b -> c -> Either a b -> c
+ Foundation: either :: () => (a -> c) -> (b -> c) -> Either a b -> c
- Foundation: first :: Bifunctor p => a -> b -> p a c -> p b c
+ Foundation: first :: Bifunctor p => (a -> b) -> p a c -> p b c
- Foundation: flip :: () => a -> b -> c -> b -> a -> c
+ Foundation: flip :: () => (a -> b -> c) -> b -> a -> c
- Foundation: fmap :: Functor f => a -> b -> f a -> f b
+ Foundation: fmap :: Functor f => (a -> b) -> f a -> f b
- Foundation: liftA2 :: Applicative f => a -> b -> c -> f a -> f b -> f c
+ Foundation: liftA2 :: Applicative f => (a -> b -> c) -> f a -> f b -> f c
- 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: on :: () => b -> b -> c -> a -> b -> a -> a -> c
+ Foundation: on :: () => (b -> b -> c) -> (a -> b) -> a -> a -> c
- Foundation: second :: Bifunctor p => b -> c -> p a b -> p a c
+ Foundation: second :: Bifunctor p => (b -> c) -> p a b -> p a c
- Foundation: type family Difference a :: *;
+ Foundation: type family Difference a :: Type;
- 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: 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.Array.Internal: withPtr :: (PrimMonad prim, PrimType ty) => UArray ty -> Ptr ty -> prim a -> prim a
+ Foundation.Array.Internal: withPtr :: (PrimMonad prim, PrimType ty) => UArray ty -> (Ptr ty -> prim a) -> prim a
- 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: [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: data BuildingState collection (mutCollection :: * -> *) step state
+ Foundation.Collection: data BuildingState collection (mutCollection :: Type -> Type) step state
- Foundation.Collection: newtype Builder collection (mutCollection :: * -> *) step (state :: * -> *) err a
+ Foundation.Collection: newtype Builder collection (mutCollection :: Type -> Type) step (state :: Type -> Type) err 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.IO: hPut :: Handle -> (UArray Word8) -> IO ()
+ Foundation.IO: hPut :: Handle -> UArray Word8 -> IO ()
- Foundation.Monad: class AMPMonad m => MonadFailure (m :: * -> *) where {
+ Foundation.Monad: class AMPMonad m => MonadFailure (m :: Type -> Type) where {
- Foundation.Monad: class Monad m => MonadIO (m :: * -> *)
+ Foundation.Monad: class Monad m => MonadIO (m :: Type -> Type)
- Foundation.Monad: type family Failure (m :: * -> *) :: *;
+ Foundation.Monad: type family Failure (m :: Type -> Type) :: Type;
- Foundation.Numerical: (^) :: (Multiplicative a, IsNatural n, IDivisible n) => a -> n -> a
+ Foundation.Numerical: (^) :: (Multiplicative a, IsNatural n, Enum n, IDivisible n) => a -> n -> a
- Foundation.Numerical: class (Enum a, Eq a, Ord a, Integral a) => IsIntegral a
+ Foundation.Numerical: class (Integral a, Eq a, Ord a) => IsIntegral a
- Foundation.Numerical: class (Enum a, Eq a, Ord a, Integral a, IsIntegral a) => IsNatural a
+ Foundation.Numerical: class IsIntegral a => IsNatural a
- Foundation.Numerical: type family Difference a :: *;
+ Foundation.Numerical: type family Difference a :: Type;
- Foundation.Parser: Expected :: (Chunk input) -> (Chunk input) -> ParseError input
+ Foundation.Parser: Expected :: Chunk input -> Chunk input -> ParseError input
- Foundation.Parser: ExpectedElement :: (Element input) -> (Element input) -> ParseError input
+ Foundation.Parser: ExpectedElement :: Element input -> Element input -> ParseError input
- Foundation.Parser: NotEnough :: (CountOf (Element input)) -> ParseError input
+ Foundation.Parser: NotEnough :: CountOf (Element input) -> ParseError input
- Foundation.Parser: ParseFailed :: (ParseError input) -> Result input result
+ Foundation.Parser: ParseFailed :: ParseError input -> Result input result
- Foundation.Parser: ParseOk :: (Chunk input) -> result -> Result input result
+ Foundation.Parser: ParseOk :: Chunk input -> result -> Result input result
- Foundation.Parser: Satisfy :: (Maybe String) -> ParseError input
+ Foundation.Parser: Satisfy :: Maybe String -> ParseError input
- Foundation.Parser: optional :: Alternative f => f a -> f Maybe a
+ Foundation.Parser: optional :: Alternative f => f a -> f (Maybe a)
- Foundation.Primitive: class (Functor m, Applicative m, Monad m) => PrimMonad (m :: * -> *) where {
+ Foundation.Primitive: class (Functor m, Applicative m, Monad m) => PrimMonad (m :: Type -> Type) 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 -> (# State# PrimState m, a #) -> m a
+ Foundation.Primitive: primitive :: PrimMonad m => (State# (PrimState m) -> (# State# (PrimState m), a #)) -> m a
- Foundation.Primitive: type family PrimVar (m :: * -> *) :: * -> *;
+ Foundation.Primitive: type family PrimVar (m :: Type -> Type) :: Type -> Type;
- Foundation.Primitive: unPrimMonad :: PrimMonad m => m a -> State# PrimState m -> (# State# PrimState m, a #)
+ Foundation.Primitive: unPrimMonad :: PrimMonad m => m a -> State# (PrimState m) -> (# State# (PrimState m), a #)
- Foundation.Random: MonadRandomState :: gen -> (a, gen) -> MonadRandomState gen a
+ Foundation.Random: MonadRandomState :: (gen -> (a, gen)) -> MonadRandomState gen a
- Foundation.Timing: Timing :: !NanoSeconds -> !(Maybe Word64) -> Timing
+ Foundation.Timing: Timing :: !NanoSeconds -> !Maybe Word64 -> Timing
- Foundation.Timing: [timeBytesAllocated] :: Timing -> !(Maybe Word64)
+ Foundation.Timing: [timeBytesAllocated] :: Timing -> !Maybe Word64

Files

Foundation/Conduit/Internal.hs view
@@ -11,6 +11,8 @@ {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE Rank2Types #-} {-# LANGUAGE OverloadedStrings #-}+{-# OPTIONS_GHC -Wno-inline-rule-shadowing #-}+ module Foundation.Conduit.Internal     ( Pipe(..)     , Conduit(..)
Foundation/Network/IPv4.hs view
@@ -28,7 +28,7 @@ import Data.Proxy import Foundation.String (String) import Foundation.Primitive-import Foundation.Bits+import Basement.Bits import Foundation.Parser hiding (peek) import Foundation.Collection (Sequential, Element, elem) 
Foundation/Time/StopWatch.hs view
@@ -107,5 +107,7 @@         pure $ NanoSeconds $ (endSec * secondInNano + endNSec) - (startSec * secondInNano + startNSec) #endif +#if !defined(darwin_HOST_OS) secondInNano :: Word64 secondInNano = 1000000000+#endif
Foundation/Time/Types.hs view
@@ -34,7 +34,7 @@     primAddrRead addr ofs    = primAddrRead addr (coerce ofs)     primAddrWrite addr ofs v = primAddrWrite addr (coerce ofs) (coerce v :: Word64) --- | An amount of nanoseconds+-- | An amount of seconds newtype Seconds = Seconds Word64     deriving (Show,Eq,Ord,Additive,Enum,Bounded) 
+ benchs/LargeWords.hs view
@@ -0,0 +1,45 @@+{-# LANGUAGE NoImplicitPrelude #-}+{-# LANGUAGE RebindableSyntax #-}+{-# LANGUAGE OverloadedStrings #-}+{-# LANGUAGE TypeApplications #-}+module LargeWords where++import Foundation+import Basement.From+import Basement.Types.Word128 (Word128)+import Basement.Types.Word256 (Word256)+import qualified Basement.Types.Word128 as Word128+import qualified Basement.Types.Word256 as Word256+import BenchUtil.Common++largeNumber64 :: Natural+largeNumber64 = 0xffffffffffffffff++largeNumber128 :: Natural+largeNumber128 = 0xfffffffffffffffffffffffffffffff++largeNumber256 :: Natural+largeNumber256 = 0xffffffffffffffffffffffffffffffffffffffffffffffff++benchLargeWords =+    [ bgroup "Addition"+        [ bgroup "Word128"+            [ bench "Word128" $ whnf (+ 1240) (Word128.fromNatural largeNumber128)+            , bench "Natural" $ whnf (+ 1240) largeNumber128+            ]+        , bgroup "Word256"+            [ bench "Word256" $ whnf (+ 200) (Word256.fromNatural largeNumber256)+            , bench "Natural" $ whnf (+ 200) largeNumber256+            ]+        ]+    , bgroup "Multiplication"+        [ bgroup "Word128"+            [ bench "Word128" $ whnf (* 1240) (Word128.fromNatural largeNumber128)+            , bench "Natural" $ whnf (* 1240) largeNumber128+            ]+        , bgroup "Word256"+            [ bench "Word256" $ whnf (* 200) (Word256.fromNatural largeNumber256)+            , bench "Natural" $ whnf (* 200) largeNumber256+            ]+        ]+    ]
benchs/Main.hs view
@@ -16,6 +16,7 @@ import qualified Basement.Block.Builder as Builder  import Sys+import LargeWords  #ifdef BENCH_ALL import qualified Data.ByteString as ByteString@@ -353,4 +354,5 @@ main = defaultMain     [ benchsTypes     , bgroup "Sys" benchSys+    , bgroup "LargeWord" benchLargeWords     ]
foundation.cabal view
@@ -1,5 +1,5 @@ name:                foundation-version:             0.0.21+version:             0.0.22 synopsis:            Alternative prelude with batteries and no dependencies description:     A custom prelude with no dependencies apart from base.@@ -203,8 +203,10 @@                    , ghc-prim     if os(windows)       build-depends: Win32+      if arch(i386)+        extra-libraries: gcc -  build-depends: basement == 0.0.8+  build-depends: basement == 0.0.9    -- FIXME add suport for armel mipsel   --  CPP-options: -DARCH_IS_LITTLE_ENDIAN@@ -246,7 +248,7 @@   default-extensions: NoImplicitPrelude                       RebindableSyntax                       OverloadedStrings-  build-depends:     base+  build-depends:     base > 0 && < 1000                    , basement                    , foundation   ghc-options:       -Wall -fno-warn-orphans -fno-warn-missing-signatures@@ -262,7 +264,7 @@   default-extensions: NoImplicitPrelude                       RebindableSyntax   if flag(linktest)-    build-depends:     base+    build-depends:     base > 0 && < 1000                      , foundation                      , template-haskell     buildable:     True@@ -292,6 +294,7 @@   other-modules:     BenchUtil.Common                      BenchUtil.RefData                      Sys+                     LargeWords                      Fake.ByteString                      Fake.Text                      Fake.Vector