From 125a792ec885d16fc0e41751d073caf2da9f2301 Mon Sep 17 00:00:00 2001 From: Jasper Van der Jeugt Date: Tue, 28 Jul 2020 23:25:57 +0200 Subject: Mess around --- server/cafp.cabal | 41 +++++++++++++++++++++++------------------ server/src/GenerateElmTypes.hs | 13 +++++++++++++ server/src/GenerateTypes.hs | 4 ---- 3 files changed, 36 insertions(+), 22 deletions(-) create mode 100644 server/src/GenerateElmTypes.hs delete mode 100644 server/src/GenerateTypes.hs (limited to 'server') diff --git a/server/cafp.cabal b/server/cafp.cabal index 08b479c..fc52b4f 100644 --- a/server/cafp.cabal +++ b/server/cafp.cabal @@ -1,14 +1,14 @@ -Name: cafp -Version: 0.1.0 -Synopsis: Cards Against Functional Programming -License: BSD3 -License-file: LICENSE -Author: Jasper Van der Jeugt -Maintainer: Jasper Van der Jeugt -Copyright: 2020 Jasper Van der Jeugt -Category: Language -Build-type: Simple -Cabal-version: 1.18 +Name: cafp +Version: 0.1.0 +Synopsis: Cards Against Functional Programming +License: BSD3 +License-file: LICENSE +Author: Jasper Van der Jeugt +Maintainer: Jasper Van der Jeugt +Copyright: 2020 Jasper Van der Jeugt +Category: Language +Build-type: Simple +Cabal-version: 1.18 Library Default-language: Haskell2010 @@ -19,11 +19,16 @@ Library Cafp.Messages Build-depends: - base >= 4.9 && < 5 + base >= 4.9 && < 5, + elm-bridge >= 0.5 && < 0.6 -Executable cafp-generate-types - Hs-source-dirs: src - Main-is: GenerateTypes.hs - Default-language: Haskell2010 - Ghc-options: -Wall - build-depends: base, cafp +Executable cafp-generate-elm-types + Hs-source-dirs: src + Main-is: GenerateElmTypes.hs + Default-language: Haskell2010 + Ghc-options: -Wall + + Build-depends: + base >= 4.9 && < 5, + cafp, + elm-bridge >= 0.5 && < 0.6 diff --git a/server/src/GenerateElmTypes.hs b/server/src/GenerateElmTypes.hs new file mode 100644 index 0000000..e8aa25b --- /dev/null +++ b/server/src/GenerateElmTypes.hs @@ -0,0 +1,13 @@ +{-# OPTIONS_GHC -fno-warn-orphans #-} +{-# LANGUAGE TemplateHaskell #-} +import Cafp.Messages +import Elm.Derive +import Elm.Module +import Data.Proxy + +deriveBoth defaultOptions ''ServerMessage + +main :: IO () +main = putStrLn $ makeElmModule "Messages" + [ DefineElm (Proxy :: Proxy ServerMessage) + ] diff --git a/server/src/GenerateTypes.hs b/server/src/GenerateTypes.hs deleted file mode 100644 index 730d9fb..0000000 --- a/server/src/GenerateTypes.hs +++ /dev/null @@ -1,4 +0,0 @@ -import Cafp.Messages - -main :: IO () -main = print Welcome -- cgit v1.2.3