barbies: Classes for working with types that can change clothes.

[ bsd3, data-structures, library ] [ Propose Tags ]

Types that are parametric on a functor are like Barbies that have an outfit for each role. This package provides the basic abstractions to work with them comfortably.

[Skip to Readme]


Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees


Versions [RSS],,,,,,,,,,,,,,,,,,,, (info)
Change log
Dependencies base (>=4.11 && <5), distributive, transformers [details]
License BSD-3-Clause
Copyright 2018 Daniel Gorin
Author Daniel Gorin
Category Data Structures
Home page
Bug tracker
Source repo head: git clone
Uploaded by DanielGorin at 2024-01-13T13:46:09Z
Distributions Arch:, LTSHaskell:, NixOS:, Stackage:
Reverse Dependencies 12 direct, 184 indirect [details]
Downloads 23284 total (370 in the last 30 days)
Rating 2.25 (votes: 2) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Docs available [build log]
Last success reported on 2024-01-13 [all 1 reports]

Readme for barbies-

[back to package description]

barbies Build Status

Types that are parametric on unary type-constructors that control their shapes are like Barbies that can wear different clothes to become a different doll. This is a common Haskell-idiom. E.g.,

data Person f
  = Person
      { name :: f String
      , age  :: f Int

b1 :: Person Last       -- Barbie with a monoid structure
b2 :: Person (Const a)  -- container Barbie
b3 :: Person Identity   -- Barbie's new clothes

This package provides basic classes and abstractions to work with these types and easily transform them. See the docs to learn more.

  • barbies-th: Use Template Haskell to derive barbie-types from declarations that look like normal types.
  • higgledy: Use Generics to give a barbie-type interface to a normal type.
  • harg: Program-configuration (from command-line arguments, environment variables, configuration files, etc) via barbie-types