aboutsummaryrefslogtreecommitdiffhomepage
path: root/std/IO.bruijn
blob: fdc9295b001bebb2f9704eb8b37f9fa5945e0ab2 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
# MIT License, Copyright (c) 2024 Marvin Borner

:input std/Monad/List .

:import std/Char C
:import std/Combinator .

# reads a single char monadically
get-char read

# reads a line monadically
get-line y [read >>= [(C.eq? 0 '\n') (pure [[0]]) (1 >>= [pure [0 2 1]])]]