aboutsummaryrefslogtreecommitdiff
path: root/src/Main.hs
diff options
context:
space:
mode:
authorJosh Rahm <joshuarahm@gmail.com>2024-02-08 21:08:00 -0700
committerJosh Rahm <joshuarahm@gmail.com>2024-02-08 21:08:00 -0700
commitdac9d40ce5f4f1bee733acb1ed91b301c899c2d6 (patch)
treea69c70ab730a4fcf8691c473d9d33b836ddc3f4e /src/Main.hs
parent3e5cdf208606700b45acecf7c8a0b366a8caa106 (diff)
downloadmontis-dac9d40ce5f4f1bee733acb1ed91b301c899c2d6.tar.gz
montis-dac9d40ce5f4f1bee733acb1ed91b301c899c2d6.tar.bz2
montis-dac9d40ce5f4f1bee733acb1ed91b301c899c2d6.zip
Made some more complex state in Wetterhorn.
Things are still purely for testing as I figure out how best to handle the ffi boundary, though things are starting to make sense.
Diffstat (limited to 'src/Main.hs')
-rw-r--r--src/Main.hs20
1 files changed, 12 insertions, 8 deletions
diff --git a/src/Main.hs b/src/Main.hs
index c43ef13..2d15fce 100644
--- a/src/Main.hs
+++ b/src/Main.hs
@@ -1,14 +1,18 @@
+{-# HLINT ignore "Use camelCase" #-}
+
module Main (main) where
import Control.Monad.Writer (execWriter, MonadWriter (tell))
-foreign export ccall call_in :: IO ()
-call_in :: IO ()
-call_in = putStrLn $ execWriter $ do
- tell "Yo,"
- tell " This was "
- tell "Called"
- tell " From"
- tell " C!!"
+import Wetterhorn.Core
+
+foreign export ccall wetterhorn :: IO Wetterhorn
+wetterhorn :: IO Wetterhorn
+wetterhorn =
+ initWetterhorn $
+ WConfig "This is a string"
+ (do
+ (WState str _) <- getWState
+ wio $ putStrLn $ "Handle something!!! :) " ++ str)
main :: IO ()
main = putStrLn "This should be dynamically linked!\n"