[ANN] fcf-containers v0.8.1 is out, with improved Control.Monad instances

Happy to announce again about the new version!

Skyfold wrote several new instances to Control.Monad and generalized the KnownVal instances to much better β†’ big thanks to Skyfold!!

E.g. please do consider the following, where the FT refers to FCF.Data.Tree and DT to Data.Tree from containers. This is an example how these utilities make it much easier to move values from type level calculations to value level.

type ExTr4 =
    'FT.Node ('Left 1)
        '[ 'FT.Node ('Right "two")
            '[ 'FT.Node ('Left 3)
                '[ 'FT.Node ('Right "four") '[]]
             ]
         , 'FT.Node ('Left 5)
            '[ 'FT.Node ('Right "six") '[]
             ]
         ]

specTrees :: Spec
specTrees = describe "Tree structures" $ do
  it "tree 4" $ do
    let test :: forall r. (r ~ ExTr4) 
             => DT.Tree (Either Int String)
        test = fromType (Proxy @r)
    test 
      `shouldBe` 
      DT.Node (Left 1) 
        [ DT.Node (Right "two") 
          [ DT.Node (Left 3) 
            [ DT.Node (Right "four") []
            ]
          ]
        , DT.Node (Left 5) 
          [DT.Node (Right "six") []
          ]
        ]
5 Likes

Here’s a link to the package on Hackage:

2 Likes