Skip to content

Commit

Permalink
Update netpbm.dx to the new syntax.
Browse files Browse the repository at this point in the history
  • Loading branch information
axch committed Mar 25, 2023
1 parent c003332 commit 0d845be
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/netpbm.dx
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
import parser

data Image =
MkImage rows:Nat cols:Nat pixels:(Fin rows => Fin cols => Fin 3 => Word8)
MkImage(rows:Nat, cols:Nat, pixels:(Fin rows => Fin cols => Fin 3 => Word8))

def parse_p6 : Parser Image = MkParser \h.
parse_p6 : Parser Image = MkParser \h.
-- Loads a raw PPM file in P6 format.
-- The header will look something like:
-- P6
Expand All @@ -29,6 +29,6 @@ def parse_p6 : Parser Image = MkParser \h.
parse h parse_any
MkImage rows cols pixels

def load_image_p6 (filename:String) : Maybe Image =
image_raw = unsafe_io do read_file filename
def load_image_p6(filename:String) -> Maybe Image =
image_raw = unsafe_io \. read_file filename
run_parser_partial image_raw parse_p6

0 comments on commit 0d845be

Please sign in to comment.