Skip to content

haskellari/some

Folders and files

NameName
Last commit message
Last commit date

Latest commit

892bd38 · Dec 22, 2024
Dec 22, 2024
Oct 12, 2023
Oct 4, 2022
Apr 5, 2021
Mar 26, 2020
Mar 17, 2021
Oct 24, 2023
Sep 12, 2019
Sep 6, 2019
Sep 23, 2019
Oct 4, 2022
Sep 12, 2019
Dec 22, 2024

Repository files navigation

some

This library defines several versions of an existential type 'Some', which works like this datastructure:

data Some f where
    Some :: f a -> Some f

and operations to work with it.

However, due to GHC issue #1965, the direct implementation of this datastructure is less efficient than it could be. As a result, this library uses a more complex approach that implements it as a newtype, so there's no runtime overhead associated with wrapping and unwrapping Some values.

To use the recommended implementation, import Data.Some. If you need to ensure that you are definitely using the newtype implementation, import Data.Some.Newtype. By default, these are the same, but this can be changed via a Cabal flag.