HORIZON HASKELLDocslts/ghc-9.10.x248f8f02026-10-05Search names, modules, packages, or :: a typeCtrl K

GHC 9.10.3 · lts/ghc-9.10.x · 248f8f0 · 2026-10-05

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, …