Skip to content

Commit 34397bb

Browse files
committed
grade-school: replace zip (repeat g) with map (g,)
https://github.com/ndmitchell/hlint/blob/master/CHANGES.txt 3.5, released 2022-09-20 [#1421][1421], change zip/repeat to map with tuple section [1421]: ndmitchell/hlint#1421
1 parent 27ddf01 commit 34397bb

File tree

1 file changed

+2
-1
lines changed
  • exercises/practice/grade-school/test

1 file changed

+2
-1
lines changed

exercises/practice/grade-school/test/Tests.hs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
{-# OPTIONS_GHC -fno-warn-type-defaults #-}
2+
{-# LANGUAGE TupleSections #-}
23

34
import Test.Hspec (Spec, it, shouldBe)
45
import Test.Hspec.Runner (configFastFail, defaultConfig, hspecWith)
@@ -12,7 +13,7 @@ specs :: Spec
1213
specs = do
1314

1415
let fromList = foldr (uncurry add) empty
15-
let fromGrade g = fromList . zip (repeat g)
16+
let fromGrade g = fromList . map (g,)
1617

1718
it "add student" $
1819
sorted (add 2 "Aimee" empty) `shouldBe` [(2, ["Aimee"])]

0 commit comments

Comments
 (0)