Stylish Haskell

This commit is contained in:
Nox Sluijtman 2024-11-18 17:24:26 +01:00
parent f12134bf55
commit 7d8bf5d857
Signed by: Egg
SSH key fingerprint: SHA256:2sG9X3C7Xvq2svGumz1/k7cm8l4G9+qAtAeugqB4J9M
7 changed files with 51 additions and 56 deletions

View file

@ -35,6 +35,7 @@
haskellPackages.haskell-language-server # you must build it with your ghc to work
ghcid
cabal-install
stylish-haskell
];
inputsFrom = map (__getAttr "env") (__attrValues self.packages.${system});
};

View file

@ -5,7 +5,7 @@ module DND
, module DND.Dice
) where
import DND.Bob
import DND.Dice
import DND.Sheet.Content
import DND.Sheet.Parser
import DND.Dice
import DND.Bob

View file

@ -3,10 +3,10 @@ module DND.Bob (bob) where
import DND.Sheet.Content
bob :: Character
bob = Character {skills=testSkills, trivia=testTrivia, stats=testStats, spells=Just testSpells, preamble=testPreamble, feats=Just testFeatures}
bob = Character {skills = testSkills, trivia = testTrivia, stats = testStats, spells = Just testSpells, preamble = testPreamble, feats = Just testFeatures}
testStats :: [Stat]
testStats = [strStat,dexStat,conStat,intStat,wisStat,chaStat]
testStats = [strStat, dexStat, conStat, intStat, wisStat, chaStat]
testPreamble :: Preamble
testPreamble = Preamble 1 "Bob" "Elf" "Fighter" False

View file

@ -11,11 +11,10 @@ module DND.Sheet.Content
, SpellComponent(..)
, Feature(..)
, FeatInfo(..)
, fiets
) where
import Data.Aeson ( FromJSON, ToJSON )
import GHC.Generics ( Generic )
import Data.Aeson (FromJSON, ToJSON)
import GHC.Generics (Generic)
instance FromJSON Character
instance ToJSON Character
@ -84,11 +83,6 @@ data Skill = Skill
, relatedStat :: String
} deriving ( Show, Eq, Ord, Generic)
fiets = Skill { skillName = "Stuff"
, skillMod = None
, relatedStat = "Strength"
}
data Stat = Stat
{ statName :: String
, score :: Int

View file

@ -8,13 +8,13 @@ module DND.Sheet.Parser
, listSkillNames
) where
import Data.Aeson
import DND.Sheet.Content
import DND.Bob(bob)
import Control.Monad
import Data.Aeson
import qualified Data.ByteString.Lazy as B
import qualified Data.ByteString.Lazy.UTF8 as BSU
import Data.Maybe (fromJust)
import DND.Bob (bob)
import DND.Sheet.Content
--getSheet :: FilePath -> IO B.ByteString
--getSheet = B.readFile