Skip to content

Commit

Permalink
Stdin hopefully now works?
Browse files Browse the repository at this point in the history
  • Loading branch information
RubenVerg committed Nov 24, 2024
1 parent fd7e11c commit a1f972e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
6 changes: 3 additions & 3 deletions app/TinyAPL/CLI.hs
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@ stdin = Nilad (Just $ let
done <- liftToSt $ isEOF >>= (\x -> rnf x `seq` pure x)
if done then pure text
else do
str <- liftToSt $ getContents >>= (\x -> rnf x `seq` pure x)
go $ text ++ str
in vector . fmap Character <$> go "") Nothing (G.quad : "stdin") Nothing
ch <- liftToSt $ getChar >>= (\x -> rnf x `seq` pure x)
go $ ch : text
in vector . fmap Character . reverse <$> go "") Nothing (G.quad : "stdin") Nothing

cli :: IO ()
cli = do
Expand Down
1 change: 1 addition & 0 deletions cat.tinyapl
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
⎕←⎕stdin

0 comments on commit a1f972e

Please sign in to comment.