packages feed

mfmts-1.1.0.0: cid/MultiFormats/CID/Parser.hs

-- | Module      : MultiFormats.CID.Parser
--   Description : Provides parsing types for CID
--   Copyright   : Zoey McBride (c) 2026
--   License     : AGPL-3.0-or-later
--   Maintainer  : zoeymcbride@mailbox.org
--   Stability   : experimental
--
-- This file provides a type-class `Parser` for parsing CID data from a
-- multibase encoded string. It also provides the type-alias `ParseMethod` for
-- the function signature Parsing some type a from String.
module MultiFormats.CID.Parser (Parser (parser), ParseMethod) where

import Data.Text (Text)
import MultiFormats.CID.Errors (Okay)

-- | Alias for function signature for parsing a String into some `a`.
type ParseMethod a = Text -> Okay a

-- | Generic function signature for parsing CID components from Strings.
class Parser a where
  parser :: Text -> Okay a