fcf-containers 0.7.1 → 0.7.2
raw patch · 4 files changed
+69/−2 lines, 4 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
+ Fcf.Data.List.Utils: data Foldl :: (b -> a -> Exp b) -> b -> t a -> Exp b
Files
- CHANGELOG.md +7/−0
- README.md +8/−1
- fcf-containers.cabal +2/−1
- src/Fcf/Data/List/Utils.hs +52/−0
CHANGELOG.md view
@@ -1,4 +1,11 @@ +# 0.7.2++2023015++- Add notes about defunctionalization and associated code examples+- Add helper module for Foldl method (it would be better at first-class-families lib).+ # 0.7.1 20220601
README.md view
@@ -79,7 +79,14 @@ cabal run haiku ``` +Please, do take a look of the notes made for the Helsinki Haskell meetup+on 11th January 2023+[notes](https://github.com/gspia/fcf-containers/blob/master/examples/20230111_hhslides.md)+and the associated +[code examples](https://github.com/gspia/fcf-containers/blob/master/examples/20230111_hhmeetup.hs). ++ ## Random Notes ### Partiality and anonymous functions@@ -91,7 +98,7 @@ We don't have lambdas, but if you can write the helper function in point-free form, it might can be used directly without any global function definition. Remember, that `(<=<)` corresponds to term-level `(.)` and `(=<<)` to -term-level function application `($)`. See also Maguire's book +term-level function application `($)`. See also Maguire's book (Thinking with Types).
fcf-containers.cabal view
@@ -7,7 +7,7 @@ contents of containers-package and show how these can be used. Everything is based on the ideas given in the first-class-families -package. Homepage: https://github.com/gspia/fcf-containers-Version: 0.7.1+Version: 0.7.2 Build-type: Simple Author: gspia Maintainer: iahogsp@gmail.com@@ -24,6 +24,7 @@ exposed-modules: Fcf.Control.Monad , Fcf.Data.MapC , Fcf.Data.Bitree+ , Fcf.Data.List.Utils , Fcf.Data.NatMap , Fcf.Data.Set , Fcf.Data.Text
+ src/Fcf/Data/List/Utils.hs view
@@ -0,0 +1,52 @@+{-# LANGUAGE DataKinds #-}+{-# LANGUAGE PolyKinds #-}+{-# LANGUAGE TypeFamilies #-}+{-# LANGUAGE TypeInType #-}+{-# LANGUAGE TypeOperators #-}+{-# LANGUAGE UndecidableInstances #-}+{-# OPTIONS_GHC -Wall #-}+{-# OPTIONS_GHC -Werror=incomplete-patterns #-}++{-|+Module : Fcf.Data.List.Utils+Description : List helpers / utils+Copyright : (c) gspia 2023-+License : BSD+Maintainer : gspia++= Fcf.Data.List.Utils++The following would probably have better place at the first-class-families+library. That is, polish and make a PR.++-}+++--------------------------------------------------------------------------------++module Fcf.Data.List.Utils where++import Fcf as Fcf+import Fcf.Data.List as Fcf++--------------------------------------------------------------------------------++-- For the doctests:++-- $setup+-- >>> import qualified GHC.TypeLits as TL+-- >>> import Fcf.Data.Nat++--------------------------------------------------------------------------------++-- | Foldl in terms of Foldr.+--+-- === __Example__+--+-- >>> :kind! Eval (Foldl (Fcf.-) 10 '[3,2,1])+-- Eval (Foldl (Fcf.-) 10 '[3,2,1]) :: Nat+-- = 4+--+data Foldl :: (b -> a -> Exp b) -> b -> t a -> Exp b+type instance Eval (Foldl f b ta) = Eval (Foldr (Flip f) b (Eval (Reverse ta)))+