initial commit

This commit is contained in:
macocianradu
2021-10-16 17:31:01 +02:00
parent 2681d8e3e1
commit 76f2099361
32 changed files with 1524 additions and 0 deletions

View File

@@ -0,0 +1,17 @@
{-# LANGUAGE OverloadedStrings #-}
module PrettyPrinter.Function where
import Prettyprinter
import Model.Function
import PrettyPrinter.General
import PrettyPrinter.Type
-- show printStatementTree
printFunctionSignature :: Function -> Doc a
printFunctionSignature (MakeFunction name description inputs output _) =
printDescription description (pretty name <+> prettyPrintType (Prelude.map printCardinality (inputs ++ [output])))
prettyPrintType :: [Doc x] -> Doc x
prettyPrintType = align . sep . Prelude.zipWith (<+>) ("::" : repeat "->")