Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/kakkun61/barbies-layered
https://github.com/kakkun61/barbies-layered
haskell
Last synced: about 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/kakkun61/barbies-layered
- Owner: kakkun61
- License: other
- Created: 2021-07-15T15:04:10.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2022-02-26T10:16:47.000Z (almost 3 years ago)
- Last Synced: 2024-10-30T15:24:33.424Z (3 months ago)
- Topics: haskell
- Language: Haskell
- Homepage: https://hackage.haskell.org/package/barbies-layered
- Size: 44.9 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
README
# barbies-layered
[![Hackage](https://matrix.hackage.haskell.org/api/v2/packages/barbies-layered/badge)](http://hackage.haskell.org/package/barbies-layered)
![CI](https://github.com/kakkun61/barbies-layered/workflows/main/badge.svg)
[![Sponsor](https://img.shields.io/badge/Sponsor-%E2%9D%A4-red?logo=GitHub)](https://github.com/sponsors/kakkun61)
This is like [barbies](https://hackage.haskell.org/package/barbies) but these clothes are layered.
For example when there is a following data type,
```haskell
data Foo = Foo { foo :: [Int] }
```barbies requires a following.
```haskell
data Foo f = Foo { foo :: f [Int] }
```But in case of barbies-layered,
```haskell
data Foo f = Foo { foo :: f [f Int] }
```A typical difference is a type of `bmap`.
```haskell
-- barbies
type FunctorB :: ((k -> Type) -> Type) -> Constraint
class FunctorB b where
bmap :: (forall a. f a -> g a) -> b f -> b g-- barbies-layered
type FunctorB :: ((Type -> Type) -> Type) -> Constraint
class FunctorB b where
bmap :: (Functor f, Functor g) => (forall a. f a -> g a) -> b f -> b g
```