Idris2/tests/ideMode/ideMode005/RecordUpdate.idr
Ohad Kammar e58bcfc7ef
Semantic highlighting (#1335)
Co-authored-by: Guillaume ALLAIS <guillaume.allais@ens-lyon.org>
2021-05-10 09:05:43 +01:00

24 lines
481 B
Idris

module RecordUpdate
record Attributes where
font : String
size : Nat
bigMono : Attributes -> Attributes
bigMono = record { font $= (++ "Mono")
, size = 20
}
smallMono : Attributes -> Attributes
smallMono = { size := 5 } . bigMono
-- Works for nested too
record Text where
attributes : Attributes
content : String
setArial10 : Text -> Text
setArial10 = { attributes->font := "Arial"
, attributes.size := 10
}