MyNixOS website logo
Description

Defunctionalization helpers.

The package defun provides defunctionalization helpers, most importantly type family DeFun.Core.App allowing to write higher-order type families. The singletons package also has its own type family Apply, but the machinery is tied to the Sing / singletons.

Once UnsaturatedTypeFamilies extension is implemented in GHC (Proposal 242), this package will become more or less obsolete.

In particular, the Lam counterpart SLambda is specialized to Sing arguments. The defun's Lam is however fully general, so you can use your own singletons or (importantly) singleton-like arguments.

The package provides few defunctionalized functions, and their term-level reflections using SBool and NP data types from singletons-bool and sop-core packages respectively.

This is the "batteries-included" variant with "many" dependencies; see the defun-core package and other defun-* dependencies if you need a more limited dependency footprint.

The first-class-families package has slightly different design, in particular it doesn't reuse existing (nor define) own standalone type families. In first-class-families everything has to be evaluated via its Eval type family (which job is similar to App), but defun only makes higher-order type families look different. In short, ergonomics are a bit different.

Metadata

Version

0.1

Platforms (75)

    Darwin
    FreeBSD
    Genode
    GHCJS
    Linux
    MMIXware
    NetBSD
    none
    OpenBSD
    Redox
    Solaris
    WASI
    Windows
Show all
  • aarch64-darwin
  • aarch64-genode
  • aarch64-linux
  • aarch64-netbsd
  • aarch64-none
  • aarch64_be-none
  • arm-none
  • armv5tel-linux
  • armv6l-linux
  • armv6l-netbsd
  • armv6l-none
  • armv7a-darwin
  • armv7a-linux
  • armv7a-netbsd
  • armv7l-linux
  • armv7l-netbsd
  • avr-none
  • i686-cygwin
  • i686-darwin
  • i686-freebsd
  • i686-genode
  • i686-linux
  • i686-netbsd
  • i686-none
  • i686-openbsd
  • i686-windows
  • javascript-ghcjs
  • loongarch64-linux
  • m68k-linux
  • m68k-netbsd
  • m68k-none
  • microblaze-linux
  • microblaze-none
  • microblazeel-linux
  • microblazeel-none
  • mips-linux
  • mips-none
  • mips64-linux
  • mips64-none
  • mips64el-linux
  • mipsel-linux
  • mipsel-netbsd
  • mmix-mmixware
  • msp430-none
  • or1k-none
  • powerpc-netbsd
  • powerpc-none
  • powerpc64-linux
  • powerpc64le-linux
  • powerpcle-none
  • riscv32-linux
  • riscv32-netbsd
  • riscv32-none
  • riscv64-linux
  • riscv64-netbsd
  • riscv64-none
  • rx-none
  • s390-linux
  • s390-none
  • s390x-linux
  • s390x-none
  • vc4-none
  • wasm32-wasi
  • wasm64-wasi
  • x86_64-cygwin
  • x86_64-darwin
  • x86_64-freebsd
  • x86_64-genode
  • x86_64-linux
  • x86_64-netbsd
  • x86_64-none
  • x86_64-openbsd
  • x86_64-redox
  • x86_64-solaris
  • x86_64-windows