import { map , Maybe } from "./Maybe" ; export function isNumber ( n ) { return typeof n === "number" && isFinite ( n ) ; } export function toF ( n ) { if ( n == null ) return ; if ( isNumber ( n ) ) return n ; try { return parseFloat ( String ( n ) ) ; } catch { return undefined ; } } export function toI ( n ) { return map ( toF ( n ) , ( f ) => Math . round ( f ) ) ; }