File tree Expand file tree Collapse file tree 7 files changed +87
-67
lines changed
compiled_starters/haskell
starter_templates/haskell/code Expand file tree Collapse file tree 7 files changed +87
-67
lines changed Original file line number Diff line number Diff line change @@ -2,6 +2,7 @@ module Main where
22
33import System.Environment
44import System.Exit
5+ import System.IO (hSetBuffering , stdout , stderr , BufferMode (NoBuffering ))
56
67matchPattern :: String -> String -> Bool
78matchPattern pattern input = do
@@ -11,6 +12,10 @@ matchPattern pattern input = do
1112
1213main :: IO ()
1314main = do
15+ -- Disable output buffering
16+ hSetBuffering stdout NoBuffering
17+ hSetBuffering stderr NoBuffering
18+
1419 args <- getArgs
1520 let pattern = args !! 1
1621 input_line <- getLine
Original file line number Diff line number Diff line change 66#
77# DON'T EDIT THIS!
88
9- name : hs-grep-clone
10- version : 0.1.0.0
11- license : BSD3
9+ name : hs-grep-clone
10+ version : 0.1.0.0
11+ license : BSD3
1212
1313dependencies :
14- - base >= 4.7 && < 5
15- - megaparsec # can help when implementing the parser
16- - parser-combinators # extends megaparsec
17- - containers # Set, Map, Seq
18- - unordered-containers # HashSet, HashMap
19- - hashable # when using your own data types with unordered-containers
20- - mtl # monad transformers to help with nested monads
14+ - base >= 4.7 && < 5
15+ - megaparsec # can help when implementing the parser
16+ - parser-combinators # extends megaparsec
17+ - containers # Set, Map, Seq
18+ - unordered-containers # HashSet, HashMap
19+ - hashable # when using your own data types with unordered-containers
20+ - mtl # monad transformers to help with nested monads
2121
2222default-extensions :
23- - BlockArguments
24- - ImportQualifiedPost
25- - LambdaCase
26- - NamedFieldPuns
27- - RecordWildCards
23+ - BlockArguments
24+ - ImportQualifiedPost
25+ - LambdaCase
26+ - NamedFieldPuns
27+ - RecordWildCards
2828
2929library :
30- source-dirs : src
30+ source-dirs : app
3131
3232executables :
3333 hs-grep-clone-exe :
34- main : Main.hs
35- source-dirs : app
34+ main : Main.hs
35+ source-dirs : app
3636 ghc-options :
37- - -threaded
38- - -rtsopts
39- - -with-rtsopts=-N
37+ - -threaded
38+ - -rtsopts
39+ - -with-rtsopts=-N
4040 dependencies :
41- - hs-grep-clone
41+ - hs-grep-clone
Original file line number Diff line number Diff line change @@ -2,6 +2,7 @@ module Main where
22
33import System.Environment
44import System.Exit
5+ import System.IO (hSetBuffering , stdout , stderr , BufferMode (NoBuffering ))
56
67matchPattern :: String -> String -> Bool
78matchPattern pattern input = do
@@ -11,6 +12,10 @@ matchPattern pattern input = do
1112
1213main :: IO ()
1314main = do
15+ -- Disable output buffering
16+ hSetBuffering stdout NoBuffering
17+ hSetBuffering stderr NoBuffering
18+
1419 args <- getArgs
1520 let pattern = args !! 1
1621 input_line <- getLine
Original file line number Diff line number Diff line change 66#
77# DON'T EDIT THIS!
88
9- name : hs-grep-clone
10- version : 0.1.0.0
11- license : BSD3
9+ name : hs-grep-clone
10+ version : 0.1.0.0
11+ license : BSD3
1212
1313dependencies :
14- - base >= 4.7 && < 5
15- - megaparsec # can help when implementing the parser
16- - parser-combinators # extends megaparsec
17- - containers # Set, Map, Seq
18- - unordered-containers # HashSet, HashMap
19- - hashable # when using your own data types with unordered-containers
20- - mtl # monad transformers to help with nested monads
14+ - base >= 4.7 && < 5
15+ - megaparsec # can help when implementing the parser
16+ - parser-combinators # extends megaparsec
17+ - containers # Set, Map, Seq
18+ - unordered-containers # HashSet, HashMap
19+ - hashable # when using your own data types with unordered-containers
20+ - mtl # monad transformers to help with nested monads
2121
2222default-extensions :
23- - BlockArguments
24- - ImportQualifiedPost
25- - LambdaCase
26- - NamedFieldPuns
27- - RecordWildCards
23+ - BlockArguments
24+ - ImportQualifiedPost
25+ - LambdaCase
26+ - NamedFieldPuns
27+ - RecordWildCards
2828
2929library :
30- source-dirs : src
30+ source-dirs : app
3131
3232executables :
3333 hs-grep-clone-exe :
34- main : Main.hs
35- source-dirs : app
34+ main : Main.hs
35+ source-dirs : app
3636 ghc-options :
37- - -threaded
38- - -rtsopts
39- - -with-rtsopts=-N
37+ - -threaded
38+ - -rtsopts
39+ - -with-rtsopts=-N
4040 dependencies :
41- - hs-grep-clone
41+ - hs-grep-clone
Original file line number Diff line number Diff line change 1- @@ -1,28 +1,24 @@
1+ @@ -1,33 +1,29 @@
22 module Main where
33
44 import System.Environment
55 import System.Exit
6+ import System.IO (hSetBuffering, stdout, stderr, BufferMode (NoBuffering))
67
78 matchPattern :: String -> String -> Bool
89 matchPattern pattern input = do
1213
1314 main :: IO ()
1415 main = do
16+ -- Disable output buffering
17+ hSetBuffering stdout NoBuffering
18+ hSetBuffering stderr NoBuffering
19+
1520 args <- getArgs
1621 let pattern = args !! 1
1722 input_line <- getLine
Original file line number Diff line number Diff line change @@ -2,6 +2,7 @@ module Main where
22
33import System.Environment
44import System.Exit
5+ import System.IO (hSetBuffering , stdout , stderr , BufferMode (NoBuffering ))
56
67matchPattern :: String -> String -> Bool
78matchPattern pattern input = do
@@ -11,6 +12,10 @@ matchPattern pattern input = do
1112
1213main :: IO ()
1314main = do
15+ -- Disable output buffering
16+ hSetBuffering stdout NoBuffering
17+ hSetBuffering stderr NoBuffering
18+
1419 args <- getArgs
1520 let pattern = args !! 1
1621 input_line <- getLine
Original file line number Diff line number Diff line change 66#
77# DON'T EDIT THIS!
88
9- name : hs-grep-clone
10- version : 0.1.0.0
11- license : BSD3
9+ name : hs-grep-clone
10+ version : 0.1.0.0
11+ license : BSD3
1212
1313dependencies :
14- - base >= 4.7 && < 5
15- - megaparsec # can help when implementing the parser
16- - parser-combinators # extends megaparsec
17- - containers # Set, Map, Seq
18- - unordered-containers # HashSet, HashMap
19- - hashable # when using your own data types with unordered-containers
20- - mtl # monad transformers to help with nested monads
14+ - base >= 4.7 && < 5
15+ - megaparsec # can help when implementing the parser
16+ - parser-combinators # extends megaparsec
17+ - containers # Set, Map, Seq
18+ - unordered-containers # HashSet, HashMap
19+ - hashable # when using your own data types with unordered-containers
20+ - mtl # monad transformers to help with nested monads
2121
2222default-extensions :
23- - BlockArguments
24- - ImportQualifiedPost
25- - LambdaCase
26- - NamedFieldPuns
27- - RecordWildCards
23+ - BlockArguments
24+ - ImportQualifiedPost
25+ - LambdaCase
26+ - NamedFieldPuns
27+ - RecordWildCards
2828
2929library :
30- source-dirs : src
30+ source-dirs : app
3131
3232executables :
3333 hs-grep-clone-exe :
34- main : Main.hs
35- source-dirs : app
34+ main : Main.hs
35+ source-dirs : app
3636 ghc-options :
37- - -threaded
38- - -rtsopts
39- - -with-rtsopts=-N
37+ - -threaded
38+ - -rtsopts
39+ - -with-rtsopts=-N
4040 dependencies :
41- - hs-grep-clone
41+ - hs-grep-clone
You can’t perform that action at this time.
0 commit comments