command-qq-0.2.2.0: Quasiquoters for external commands

Safe HaskellSafe-Inferred
LanguageHaskell2010

System.Command.QQ.Embed

Description

Haskell values embedding

Synopsis

Documentation

class Embed a where Source

Embed haskell values into external commands

I recommend using -XExtendedDefaultRules for modules where you want to embed values, it would save for annoying type annotations for numeric literals

embed . embed = embed

Minimal complete definition

Nothing

Methods

embed :: a -> String Source

Instances

Embed Char
>>> embed 'c'
"c"
Embed Double 
Embed Float 
Embed Int 
Embed Int8 
Embed Int16 
Embed Int32 
Embed Int64 
Embed Integer 
Embed Word 
Embed Word8 
Embed Word16 
Embed Word32 
Embed Word64 
Embed String
>>> embed ("hi" :: String)
"hi"
Embed CChar 
Embed CSChar 
Embed CUChar 
Embed CShort 
Embed CUShort 
Embed CInt 
Embed CUInt 
Embed CLong 
Embed CULong 
Embed CLLong 
Embed CULLong 
Embed CFloat 
Embed CDouble 
Embed CSize 
Embed Text
>>> embed ("hi" :: Text.Lazy.Text)
"hi"
Embed Text
>>> embed ("hi" :: Text.Text)
"hi"
(~) * a Integer => Embed (Ratio a)
>>> embed (3 % 5)
"0.6"