Skip to content
This repository was archived by the owner on Apr 1, 2025. It is now read-only.

Commit 0f54a5c

Browse files
committed
Stub in a serialization class for generics over precise ASTs.
1 parent a483615 commit 0f54a5c

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed
Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,13 @@
1+
{-# LANGUAGE FlexibleContexts, FlexibleInstances, OverloadedStrings #-}
12
module Serializing.SExpression.Precise
2-
() where
3+
( serializeSExpression
4+
) where
5+
6+
import Data.ByteString.Builder
7+
import GHC.Generics
8+
9+
serializeSExpression :: (Generic t, GToSExpression (Rep t)) => t -> Builder
10+
serializeSExpression t = gtoSExpression (from t) 0 <> "\n"
11+
12+
class GToSExpression f where
13+
gtoSExpression :: f (Int -> Builder) -> (Int -> Builder)

0 commit comments

Comments
 (0)