first-class-families alternatives and similar packages
Based on the "Other" category.
Alternatively, view first-class-families alternatives based on common mentions on social networks and blogs.
-
xmonad
The core of xmonad, a small but functional ICCCM-compliant tiling window manager -
parconc-examples
Sample code to accompany the book "Parallel and Concurrent Programming in Haskell" -
hid-examples
Examples to accompany the book "Haskell in Depth" -
CheatSheet
A Haskell CheatSheet in PDF and literate source formats. -
update-nix-fetchgit
A program to automatically update fetchgit values in Nix expressions -
generic-data
Generic data types in Haskell, utilities for GHC.Generics -
laborantin-hs
Experiment-management framework in Haskell -
xmonad-screenshot
Gtk-based screen capturing utility for XMonad. -
jenkinsPlugins2nix
Generate nix for Jenkins plugins. -
generic-data-surgery
Surgery for generic data types -
autonix-deps
Library for Nix expression dependency generation -
xmonad-utils
A small collection of X utilities useful when running XMonad. -
git-checklist
Manage a per-branch checklist in your github repository -
hyperloglogplus
Haskell implementation of HyperLogLog++ & MinHash for efficient cardinality and intersection estimation -
status-notifier-item
A Haskell implementation of the StatusNotifierItem protocol (https://www.freedesktop.org/wiki/Specifications/StatusNotifierItem/). -
hs-carbon
A Haskell framework for (parallel) Monte Carlo simulations -
legion-extra
Extra non-essential utilities for building legion applications. -
herf-time
time interval library loosely based on the way time is handled by the Kerf programming language -
nicovideo-translator
Nico Nico Douga (ニコニコ動画) Comment Translator -
unsafeperformst
Like unsafeperformIO, but for the ST monad. -
Randometer
A set of games that help you calibrate your intuition for randomness. -
wacom-daemon
Set of scripts to set up and customize Wacom Intuos Pro tablets -
hs-carbon-examples
Examples of Monte Carlo simulations written with Carbon
Access the most powerful time series database as a service
Do you think we are missing an alternative of first-class-families or a related project?
README
First-class type families

First-class type families are type-level functions that can be composed using higher-order functions.
The core of the idea is an extensible kind of "type-level expressions" and an open type family for evaluating such expressions.
type Exp (k :: Type) :: Type
type family Eval (e :: Exp k) :: k
This library provides that core foundation, and also exports basic first-class type families.
Example
For example, consider this simple type family:
type family FromMaybe (a :: k) (m :: Maybe k) :: k
type instance FromMaybe a 'Nothing = a
type instance FromMaybe a ('Just b) = b
With first-class-families (fcfs), it translates to a data
declaration
and instances for a single Eval
family:
import Fcf
data FromMaybe :: k -> Maybe k -> Exp k
type instance Eval (FromMaybe a 'Nothing) = a
type instance Eval (FromMaybe a ('Just b)) = b
That way, the FromMaybe
constructor can be partially applied,
and passed to higher-order fcfs such as Map
:
Eval (Map (FromMaybe 0) '[ 'Just 1, 'Nothing ]) = '[ 1, 0 ] :: [Nat]
Essential language extensions:
{-# LANGUAGE
DataKinds,
PolyKinds,
TypeFamilies,
TypeInType,
TypeOperators,
UndecidableInstances #-}
Overview
Fcf.Core
: definition ofExp
andEval
.Fcf.Combinators
: general combinators to compose first-class families.Fcf.Data.*
: first-class families on common data types.Fcf.Class.*
: overloaded first-class families.Fcf.Utils
: miscellaneous.
The top-level module Fcf
is a prelude to get acquainted with the library.
For regular use, import what you need from the specialized modules
above, preferably with explicit import lists.
import Fcf -- Simple but fragile
import Fcf.Class.Functor (FMap) -- Explicit and robust
Features
Overloaded type families
Value-level functions can be overloaded using type classes. Type families---type-level functions---are open by design, so overloading is as easy as just declaring them with more general types.
data Map :: (a -> Exp b) -> f a -> Exp (f b)
-- Instances for f = []
type instance Eval (Map f '[]) = '[]
type instance Eval (Map f (x ': xs)) = Eval (f x) ': Eval (Map f xs)
-- Instances for f = Maybe
type instance Eval (Map f 'Nothing) = 'Nothing
type instance Eval (Map f ('Just x)) = 'Just (Eval (f x))
See also
Contributions are welcome. Feel free to open an issue or make a PR on Github!