Ich bin auf PureScript 0.8.2. In PURESCRIPT Halogen, hat die component
Funktion der Signatur:Purescript Halogen Komponente Funktion: Übergeben von Argumenten im Abstand statt eines Datensatzes?
component :: forall s f g. ComponentSpec s f g -> Component s f g
wo
-- | A spec for a component.
type ComponentSpec s f g =
{ render :: s -> ComponentHTML f
, eval :: Natural f (ComponentDSL s f g)
}
So erwartet component
einen Rekord. Aber in der Halogen Template Project wird component
wie folgt genannt:
ui = component render eval
Bin ich an zwei verschiedenen component
Funktionen suchen? Oder werden Argumente, die durch Leerzeichen getrennt sind, in einen Datensatz konvertiert? Also versuchte ich folgend in psci
:
> type Point = { x :: Int, y :: Int }
> let
addP :: Point -> Int
addP p = p.x + p.y
> addP {x: 4, y: 5 }
9
> addP 4 5
Error found:
in module $PSCI
at line 1, column 1 - line 1, column 8
Could not match type
{ x :: Int
, y :: Int
}
with type
Int
....
ah, hab es, Danke! Ich erkannte, dass ich die Nuance von "purescript-halogen" nicht verstand: "0.5.14" in "Bower.json". Ich dachte, es würde die neueste Version vor 1.0 abholen, aber nicht für Versionen unter 1.0. Ref: https://docs.npmjs.com/misc/semver#caret-ranges-123-025-004 – RAbraham