Skip to content

Instantly share code, notes, and snippets.

View oisdk's full-sized avatar

Donnacha Oisín Kidney oisdk

View GitHub Profile
@rampion
rampion / HyperList.hs
Last active August 5, 2024 15:41
Demonstration of how the Hyperfunction implementation of list works.
{-# LANGUAGE BlockArguments #-}
{-# LANGUAGE Rank2Types #-}
{-# LANGUAGE TypeOperators #-}
{-# OPTIONS_GHC -Wall -Werror -Wextra -Wno-name-shadowing #-}
module HyperList where
import Data.Function ((&))
newtype a -&> b = Hyp {invoke :: (b -&> a) -> b}