quox/lib/Quox/SingletonExtra.idr

12 lines
225 B
Idris
Raw Normal View History

2024-05-23 17:01:45 -04:00
module Quox.SingletonExtra
import public Data.Singleton
public export
map : (f : a -> b) -> Singleton x -> Singleton (f x)
map f x = [|f x|]
public export
(<$>) : (f : a -> b) -> Singleton x -> Singleton (f x)
(<$>) = map