AZ
Size: a a a
AZ
AZ
type UserAPI1 = "users" :> Get '[JSON] [User]
data User = User
{ name :: String
, age :: Int
, email :: String
, registration_date :: Day
} deriving (Eq, Show, Generic)
instance ToJSON User
users1 :: [User]
users1 =
[ User "Isaac Newton" 372 "isaac@newton.co.uk" (fromGregorian 1683 3 1)
, User "Albert Einstein" 136 "ae@mc2.org" (fromGregorian 1905 12 1)
]
server1 :: Server UserAPI1
server1 = return users1
userAPI :: Proxy UserAPI1
userAPI = Proxy
app1 :: Application
app1 = serve userAPI server1
someFunc :: IO ()
someFunc = run 8081 app1
AZ
B
AL
AL
AL
AL
А⚙
p
В
if
тут что-то типо if let Ok
(num)
В
t
DF
DF
t
DF
p