From 1ad26b720da3c18a5e90f02e1816a616c4a8f77a Mon Sep 17 00:00:00 2001 From: "carpentry-heartbeat[bot]" Date: Mon, 18 May 2026 16:40:06 +0200 Subject: [PATCH] Fix Tag.to-type: unwrap Maybe from Long.from-string and Double.from-string Long.from-string and Double.from-string return (Maybe Long) and (Maybe Double), but CLI.Type.Integer and CLI.Type.Floating expect bare Long and Double. Use Maybe.from with sensible defaults (0l, 0.0) to unwrap the values. Closes #2 --- cli.carp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cli.carp b/cli.carp index 620e602..6de9261 100644 --- a/cli.carp +++ b/cli.carp @@ -59,8 +59,8 @@ (defmodule Tag (defn to-type [t s] (match t - (Integer) (CLI.Type.Integer (Long.from-string s)) - (Floating) (CLI.Type.Floating (Double.from-string s)) + (Integer) (CLI.Type.Integer (Maybe.from 0l (Long.from-string s))) + (Floating) (CLI.Type.Floating (Maybe.from 0.0 (Double.from-string s))) (Str) (CLI.Type.Str @s) (Boolean) (CLI.Type.Boolean (/= s "false"))))