diff options
author | Josh Rahm <joshuarahm@gmail.com> | 2022-03-09 00:40:17 -0700 |
---|---|---|
committer | Josh Rahm <joshuarahm@gmail.com> | 2022-03-09 00:40:17 -0700 |
commit | 5f31759994fc263e45ed067847b439bc30a53f0a (patch) | |
tree | 3ffcc20aa3be556009c861df10e917ac38773625 /src/Wordle.hs | |
parent | 66e9d8b8477075705d609a15f74eecd4e5304247 (diff) | |
download | wordleai-master.tar.gz wordleai-master.tar.bz2 wordleai-master.zip |
Diffstat (limited to 'src/Wordle.hs')
-rw-r--r-- | src/Wordle.hs | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/src/Wordle.hs b/src/Wordle.hs new file mode 100644 index 0000000..d722ffa --- /dev/null +++ b/src/Wordle.hs @@ -0,0 +1,21 @@ +{-# LANGUAGE ExistentialQuantification, RankNTypes, GADTs #-} +module Wordle where + +import Data.Set (Set) +import qualified Data.Set as Set + +data Environment = Environment { + wordLength :: Int, + wordList :: Set String +} + +newtype Hints = Hints [(Char, Hint)] + +data Hint = Correct | Contains | DoesNotContain + +data AI where + AI :: forall s. { + internalState :: s, + guessWord :: s -> Environment -> IO String, + updateHints :: s -> Hints -> IO s + } -> AI |