HORIZON HASKELLDocslts/ghc-9.10.xc74966e2026-09-27Search names, modules, packages, or :: a typeCtrl K

GHC 9.10.3 · lts/ghc-9.10.x · c74966e · 2026-09-27

ModuleOnly-0.1Haskell2010

Data.Tuple.Only

  • 1 type
  • PackageOnly-0.1
  • Exports1
  • LanguageHaskell2010
  • LicenceBSD-3-Clause
  • SourceOnly.hs
newtypenewtype Only a
#

The 1-tuple type or single-value "collection".

This type is structurally equivalent to the Identity type, but its intent is more about serving as the anonymous 1-tuple type missing from Haskell for attaching typeclass instances.

Parameter usage example:

encodeSomething (Only (42::Int))

Result usage example:

xs <- decodeSomething
forM_ xs $ \(Only id) -> {- ... -}

Constructors

Instances9Functor, Eq, Data, Ord, Read, Show, …