--- /dev/null
+{-# LANGUAGE MultiParamTypeClasses #-}
+module Data.Attoparsec.Parsable
+ ( Parsable(..)
+ )
+ where
+import qualified Data.Attoparsec.ByteString as B
+import qualified Data.Attoparsec.ByteString.Char8 as B
+import qualified Data.Attoparsec.Text as T
+import Data.Attoparsec.Number
+import Data.Attoparsec.Types
+import qualified Data.ByteString as B
+import qualified Data.ByteString.Lazy as LB
+import qualified Data.Text as T
+import qualified Data.Text.Lazy as LT
+import Data.Word
+
+-- |Class of types which have their corresponding parsers.
+--
+-- Minimal complete definition: 'parse'
+class Parsable t a where
+ parse :: Parser t a
+
+instance Parsable B.ByteString Word8 where
+ {-# INLINE CONLIKE parse #-}
+ parse = B.anyWord8
+
+instance Parsable B.ByteString Char where
+ {-# INLINE CONLIKE parse #-}
+ parse = B.anyChar
+
+instance Parsable B.ByteString B.ByteString where
+ {-# INLINE CONLIKE parse #-}
+ parse = B.takeByteString
+
+instance Parsable B.ByteString LB.ByteString where
+ {-# INLINE CONLIKE parse #-}
+ parse = B.takeLazyByteString
+
+instance Parsable B.ByteString Double where
+ {-# INLINE CONLIKE parse #-}
+ parse = B.double
+
+instance Parsable B.ByteString Number where
+ {-# INLINE CONLIKE parse #-}
+ parse = B.number
+
+instance Parsable T.Text Char where
+ {-# INLINE CONLIKE parse #-}
+ parse = T.anyChar
+
+instance Parsable T.Text T.Text where
+ {-# INLINE CONLIKE parse #-}
+ parse = T.takeText
+
+instance Parsable T.Text LT.Text where
+ {-# INLINE CONLIKE parse #-}
+ parse = T.takeLazyText
+
+instance Parsable T.Text Double where
+ {-# INLINE CONLIKE parse #-}
+ parse = T.double
+
+instance Parsable T.Text Number where
+ {-# INLINE CONLIKE parse #-}
+ parse = T.number
--- /dev/null
+--- !ditz.rubyforge.org,2008-03-06/issue
+title: Introduce 'Parsable' type class
+desc: I'll send a pull request to bos/attoparsec when it's ready.
+type: :task
+component: Lucu
+release: Lucu-1.0
+reporter: PHO <pho@cielonegro.org>
+status: :in_progress
+disposition:
+creation_time: 2011-12-19 13:01:51.401625 Z
+references: []
+
+id: d23a51590bc111f85646532c9a8538dd04aa20b4
+log_events:
+- - 2011-12-19 13:01:52.375925 Z
+ - PHO <pho@cielonegro.org>
+ - created
+ - ""
+- - 2011-12-19 13:02:07.064863 Z
+ - PHO <pho@cielonegro.org>
+ - changed status from unstarted to in_progress
+ - ""
+git_branch: