The fin package

[ Tags: bsd3, data, library ] [ Propose Tags ]

This package provides two simple types, and some tools to work with them. Also on type level as DataKinds.

-- Peano naturals
data Nat = Z | S Nat

-- Finite naturals
data Fin (n :: Nat) where
    Z :: Fin ('S n)
    S :: Fin n -> Fin ('Nat.S n)

vec implements length-indexed (sized) lists using this package for indexes.

The Data.Fin.Enum module let's work generically with enumerations.

See Hasochism: the pleasure and pain of dependently typed haskell programming by Sam Lindley and Conor McBride for answers to how and why. Read APLicative Programming with Naperian Functors by Jeremy Gibbons for (not so) different ones.

Similar packages


Versions 0, 0.0.1
Change log
Dependencies base (>=4.7 && <4.12), deepseq (>= && <1.5), hashable (>= && <1.3), nats (>=1.1.2 && <1.2), semigroups (>=0.18.4 && <0.19), void (>=0.7.2 && <0.8) [details]
License BSD3
Copyright (c) 2017 Oleg Grenrus
Author Oleg Grenrus <>
Maintainer Oleg.Grenrus <>
Category Data
Home page
Bug tracker
Source repo head: git clone
Uploaded Fri Mar 16 13:33:52 UTC 2018 by phadej
Distributions NixOS:0.0.1
Downloads 457 total (26 in the last 30 days)
Rating 2.0 (votes: 1) [estimated by rule of succession]
Your Rating
  • λ
  • λ
  • λ
Status Docs available [build log]
Last success reported on 2018-03-16 [all 1 reports]
Hackage Matrix CI




Maintainer's Corner

For package maintainers and hackage trustees