Created
April 20, 2022 21:24
-
-
Save jfdm/f1e3da71e72bd167b9cf148ed125a75f to your computer and use it in GitHub Desktop.
Something Something Something Type-Driven; Something Something Darkside; Something Something Complete
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
λΠ> show EmployeeSchema | |
"(Employee (PersonInfo ((FullName ((Firstname : String is not restricted) <+> | |
((Lastname : String is not restricted) <+> {}))) <+> | |
(((Address : String is not restricted) | |
<|> | |
((FirstLine : String is not restricted) <+> | |
((City : String is not restricted) <+> | |
((Country : String is restricted) <+> | |
((PostCode : String is not restricted) <+> {}))))) <+> | |
{}))))" | |
λΠ> :t employee0 | |
Example.employee0 : Data EmployeeSchema | |
λΠ> show employee0 | |
"{Employee = {PersonInfo = {FullName = Firstname = "Thor" <+> Lastname = "Odinson" <+> {}} <+> | |
Address = "Asgard" <+> {}}}" | |
λΠ> :t employee1 | |
Example.employee1 : Data EmployeeSchema | |
λΠ> show employee1 | |
"{Employee = {PersonInfo = {FullName = Firstname = "Loki" <+> Lastname = "Laufison" <+> {}} <+> | |
FirstLine = "The Frost Palace" <+> | |
City = "Jotun City" <+> | |
Country = "JH" <+> | |
PostCode = "JH01" <+> {} <+> {}}}" | |
λΠ> :t Query2 | |
Example.Query2 : Query EmployeeSchema | |
λΠ> show Query2 | |
"Employee/PersonInfo/Address" | |
λΠ> query Query2 employee0 | |
Just (R (Leaf Address "Asgard" RestrictedNot IsString)) | |
λΠ> query Query2 employee1 | |
Nothing | |
λΠ> :t query | |
Data.Schema.Path.query : Query i -> Data i -> Maybe (Result i) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment