def read_line.got

bend-stdio-pipes@0.2.0.0 · impl.bend:73

import bend-stdio-pipes@0.2.0.0/impl.bend as Impl
import Base

73def read_line.got(
74  got: File & Result<&1, &1, U32 & String, String>
75) -> IO(File & Result<&1, &1, U32 & String, Maybe<String>>):
76  match got:
77    case (file, Fail{error}):
78      IO.pure(File & Result<&1, &1, U32 & String, Maybe<String>>, (file, Fail{error}))
79    case (file, Done{SNil{}}):
80      IO.pure(File & Result<&1, &1, U32 & String, Maybe<String>>, (file, Done{None{}}))
81    case (file, Done{SCon{h, t}}):
82      +piece: String = SCon{h, t}
83      read_line.if(file, String.ends_with(piece, "\n"), piece)

Uses (11)

Used by (1)