mirror of
https://github.com/idris-lang/Idris2.git
synced 2024-12-19 09:12:34 +03:00
24 lines
461 B
Idris
24 lines
461 B
Idris
module RecordUpdate
|
|
|
|
record Attributes where
|
|
font : String
|
|
size : Nat
|
|
|
|
bigMono : Attributes -> Attributes
|
|
bigMono = { 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
|
|
}
|