From dac9d40ce5f4f1bee733acb1ed91b301c899c2d6 Mon Sep 17 00:00:00 2001 From: Josh Rahm Date: Thu, 8 Feb 2024 21:08:00 -0700 Subject: 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. --- src/Main.hs | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) (limited to 'src/Main.hs') 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" -- cgit