From 8e92e6e11d2b3b0bfb5ac9d68f347219493e6380 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kier=C3=A1n=20Meinhardt?= Date: Wed, 23 Sep 2020 17:44:40 +0200 Subject: split into library + executables --- Codec/MIME/Utils.hs | 33 --------------------------------- 1 file changed, 33 deletions(-) delete mode 100644 Codec/MIME/Utils.hs (limited to 'Codec/MIME/Utils.hs') diff --git a/Codec/MIME/Utils.hs b/Codec/MIME/Utils.hs deleted file mode 100644 index dd54860..0000000 --- a/Codec/MIME/Utils.hs +++ /dev/null @@ -1,33 +0,0 @@ --------------------------------------------------------------------- --- | --- Module : Codec.MIME.Utils --- Copyright : (c) 2006-2009, Galois, Inc. --- License : BSD3 --- --- Maintainer: Sigbjorn Finne --- Stability : provisional --- Portability: portable --- --- Extracting content from MIME values and types. --- --------------------------------------------------------------------- -module Codec.MIME.Utils - ( findMultipartNamed -- :: String -> MIMEValue -> Maybe MIMEValue - ) where - -import Codec.MIME.Type -import Data.List ( find ) -import Control.Monad ( msum ) -import Data.Text(Text) - --- | Given a parameter name, locate it within a MIME value, --- returning the corresponding (sub) MIME value. -findMultipartNamed :: Text -> MIMEValue -> Maybe MIMEValue -findMultipartNamed nm mv = - case mime_val_content mv of - Multi ms -> msum (map (findMultipartNamed nm) ms) - Single {} -> do cd <- mime_val_disp mv - _ <- find (withDispName nm) (dispParams cd) - return mv - where withDispName a (Name b) = a == b - withDispName _ _ = False -- cgit v1.2.3