packages feed

prologue 1.0 → 1.0.1

raw patch · 3 files changed

+52/−11 lines, 3 filesdep +vector

Dependencies added: vector

Files

prologue.cabal view
@@ -1,5 +1,5 @@ name:                prologue-version:             1.0+version:             1.0.1 synopsis:            Replacement for the Haskell's Prelude, exposing more commonly used functions and patching old GHC ones to behave in the newest GHC's way. -- description:          license:             Apache-2.0@@ -49,6 +49,7 @@                       Data.String.Class                       Data.Default.Instances.Missing                       Data.Binary.Instances.Missing+                      Data.List.Class    build-depends:      base >=4.6 && <4.9                     , binary@@ -64,3 +65,4 @@                     , transformers-base                     , text                     , string-qq+                    , vector
+ src/Data/List/Class.hs view
@@ -0,0 +1,39 @@+{-# LANGUAGE UndecidableInstances #-}+{-# LANGUAGE TypeFamilies         #-}++module Data.List.Class where++import qualified GHC.Exts                as GHC+import qualified Data.Vector             as V++-- === Types ===++type family Item l++class FromList       l where fromList         :: [Item l] -> l+                             default fromList :: (GHC.IsList l, GHC.Item l ~ Item l)+                                              => [Item l] -> l+                             fromList = GHC.fromList++class ToList         l where toList         :: l -> [Item l]+                             default toList :: (GHC.IsList l, GHC.Item l ~ Item l)+                                            => l -> [Item l]+                             toList = GHC.toList++class FromListUnsafe l where fromListUnsafe :: [Item l] -> l+class ToListUnsafe   l where toListUnsafe   :: l -> [Item l]+++class    (FromList l, ToList l) => IsList l+instance (FromList l, ToList l) => IsList l++class    (FromList l, ToList l) => IsListUnsafe l+instance (FromList l, ToList l) => IsListUnsafe l++++-- === Instances ===++type instance Item (V.Vector a) = a+instance FromList  (V.Vector a)+instance ToList    (V.Vector a)
src/Prologue.hs view
@@ -38,7 +38,6 @@ import           Data.Text.Class                    as X (FromText (fromText), IsText, ToText (toText)) import           Data.Text.Lazy                     as X (Text) import           Data.Typeable                      as X (Typeable)-import           GHC.Exts                           as X (IsList, Item, fromList, fromListN, toList) import           GHC.Generics                       as X (Generic) import           GHC.Exts                           as X (Constraint) import           Control.Monad.Fix                  as X (MonadFix)@@ -50,7 +49,8 @@ import           Data.String.QQ                     as X (s) import           GHC.TypeLits                       as X (Nat, Symbol, SomeNat, SomeSymbol, KnownNat, natVal) import           Data.Typeable                      as X (Proxy(Proxy), typeOf, typeRep)-+import           Data.Repr.Meta                     as X (MetaRepr, Meta, as')+import           Data.List.Class                    as X  (++) :: Monoid a => a -> a -> a (++) = mappend@@ -186,13 +186,13 @@   -wrapped    = _Wrapped'-unwrapped  = _Unwrapped'-wrapping   = _Wrapping'-unwrapping = _Unwrapping'+wrapped'    = _Wrapped'+unwrapped'  = _Unwrapped'+wrapping'   = _Wrapping'+unwrapping' = _Unwrapping' -polyWrapped    = _Wrapped-polyUnwrapped  = _Unwrapped-polyWrapping   = _Wrapping-polyUnwrapping = _Unwrapping+wrapped    = _Wrapped+unwrapped  = _Unwrapped+wrapping   = _Wrapping+unwrapping = _Unwrapping