Skip to content

Commit

Permalink
Install GHC via stack
Browse files Browse the repository at this point in the history
  • Loading branch information
Abhijit Sarkar committed Sep 8, 2024
1 parent 8a1c739 commit 6b3fe1d
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 3 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ jobs:
uses: haskell-actions/setup@v2
with:
enable-stack: true
stack-setup-ghc: true
stack-no-global: true

- name: Test
run: .github/run.sh --no-lint
Expand Down
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,11 @@ To use a language extension
GHCi> :set -XOverloadedStrings
```

To load a file
```
GHCi> :load path/to/file
```

To show type of something
```
GHCi> :t variable
Expand Down
2 changes: 1 addition & 1 deletion allergies/src/Allergies.hs
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@ allergies score = [allergens !! i | i <- [0 .. n], isAllergic i]
isAllergic = B.testBit score

isAllergicTo :: Allergen -> Int -> Bool
isAllergicTo allergen score = allergen `elem` allergies score
isAllergicTo = (. allergies) . elem
3 changes: 1 addition & 2 deletions crypto-square/src/CryptoSquare.hs
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,9 @@ normalize :: String -> String
normalize = map C.toLower . filter C.isAlphaNum

size :: Int -> Int
size n = col
size n = ceiling $ sqrt x
where
x = fromIntegral n :: Float
col = ceiling $ sqrt x

padR :: Int -> String -> String
padR n xs = xs ++ replicate (n - x) ' '
Expand Down

0 comments on commit 6b3fe1d

Please sign in to comment.