module BishBosh.Property.ForsythEdwards(
ReadsFEN(..),
ShowsFEN(..),
readFEN,
showFEN
) where
import qualified BishBosh.Property.ExtendedPositionDescription as Property.ExtendedPositionDescription
class Property.ExtendedPositionDescription.ReadsEPD a => ReadsFEN a where
readsFEN :: ReadS a
readsFEN = ReadS a
forall a. ReadsEPD a => ReadS a
Property.ExtendedPositionDescription.readsEPD
class Property.ExtendedPositionDescription.ShowsEPD a => ShowsFEN a where
showsFEN :: a -> ShowS
showsFEN = a -> ShowS
forall a. ShowsEPD a => a -> ShowS
Property.ExtendedPositionDescription.showsEPD
readFEN :: ReadsFEN a => String -> a
readFEN :: String -> a
readFEN String
s = case ReadS a
forall a. ReadsFEN a => ReadS a
readsFEN String
s of
[(a
a, String
_)] -> a
a
[(a, String)]
_ -> String -> a
forall a. HasCallStack => String -> a
error (String -> a) -> ShowS -> String -> a
forall b c a. (b -> c) -> (a -> b) -> a -> c
. String -> ShowS
showString String
"BishBosh.Property.ForsythEdwards.readFEN:\tfailed to parse " (String -> a) -> String -> a
forall a b. (a -> b) -> a -> b
$ String -> ShowS
forall a. Show a => a -> ShowS
shows String
s String
"."
showFEN :: ShowsFEN a => a -> String
showFEN :: a -> String
showFEN a
a = a -> ShowS
forall a. ShowsFEN a => a -> ShowS
showsFEN a
a String
""