Copyright | (c) Aleksandr Penskoi 2021 |
---|---|
License | BSD3 |
Maintainer | aleksandr.penskoi@gmail.com |
Stability | experimental |
Safe Haskell | Safe-Inferred |
Language | Haskell2010 |
NITTA.UIBackend.ViewHelper
Contents
Description
We can not autogenerate ToJSON implementation for some types, so we add helper
types for doing that automatically. Why do we need to generate ToJSON
automatically? We don't want to achieve consistency between client and server
manually.
Synopsis
- module NITTA.UIBackend.ViewHelperCls
- module NITTA.Model.Problems.ViewHelper
- data FView = FView {}
- class Viewable t v | t -> v where
- view :: t -> v
- viewNodeTree :: (Enum b, Num b, NextTick u b) => Tree (TargetSystem u tag v x t) tag v x t -> IO (TreeView ShortNodeView)
- data TreeView a
- data ShortNodeView
- data NodeView tag v x t
- newtype StepInfoView = StepInfoView Text
- type VarValTimeJSON v x t = (VarValTime v x t, ToJSONKey v, ToJSON v, ToJSON x, ToJSON t)
Documentation
Helper for JSON serialization
Instances
ToJSON FView Source # | |
Defined in NITTA.Intermediate.Types Methods toEncoding :: FView -> Encoding # toJSONList :: [FView] -> Value # toEncodingList :: [FView] -> Encoding # | |
Generic FView Source # | |
Show FView Source # | |
Viewable (F v x) FView Source # | |
type Rep FView Source # | |
Defined in NITTA.Intermediate.Types type Rep FView = D1 ('MetaData "FView" "NITTA.Intermediate.Types" "nitta-0.0.0.1-Bv1VcjPxpSzB9i0NGusGVn" 'False) (C1 ('MetaCons "FView" 'PrefixI 'True) (S1 ('MetaSel ('Just "fvFun") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text) :*: S1 ('MetaSel ('Just "fvHistory") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [Text]))) |
class Viewable t v | t -> v where Source #
Type class of helpers required for autogeneration of ToJSON and typescript types.
Instances
viewNodeTree :: (Enum b, Num b, NextTick u b) => Tree (TargetSystem u tag v x t) tag v x t -> IO (TreeView ShortNodeView) Source #
Instances
ToJSON a => ToJSON (TreeView a) Source # | |
Defined in NITTA.UIBackend.ViewHelper Methods toJSON :: TreeView a -> Value # toEncoding :: TreeView a -> Encoding # toJSONList :: [TreeView a] -> Value # toEncodingList :: [TreeView a] -> Encoding # | |
Generic (TreeView a) Source # | |
Show a => Show (TreeView a) Source # | |
ToSample (TreeView ShortNodeView) Source # | |
Defined in NITTA.UIBackend.ViewHelper Methods toSamples :: Proxy (TreeView ShortNodeView) -> [(Text, TreeView ShortNodeView)] # | |
type Rep (TreeView a) Source # | |
Defined in NITTA.UIBackend.ViewHelper type Rep (TreeView a) = D1 ('MetaData "TreeView" "NITTA.UIBackend.ViewHelper" "nitta-0.0.0.1-Bv1VcjPxpSzB9i0NGusGVn" 'False) (C1 ('MetaCons "TreeNodeView" 'PrefixI 'True) (S1 ('MetaSel ('Just "rootLabel") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 a) :*: S1 ('MetaSel ('Just "subForest") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [TreeView a]))) |
data ShortNodeView Source #
Instances
data NodeView tag v x t Source #
Instances
newtype StepInfoView Source #
Constructors
StepInfoView Text |
Instances
type VarValTimeJSON v x t = (VarValTime v x t, ToJSONKey v, ToJSON v, ToJSON x, ToJSON t) Source #
Orphan instances
ToJSON TreeInfo Source # | |
Methods toEncoding :: TreeInfo -> Encoding # toJSONList :: [TreeInfo] -> Value # toEncodingList :: [TreeInfo] -> Encoding # | |
ToSample TreeInfo Source # | |
ToSample Integer Source # | |
(ToJSONKey v, ToJSON v, ToJSON x) => ToJSON (TestbenchReport v x) Source # | |
Methods toJSON :: TestbenchReport v x -> Value # toEncoding :: TestbenchReport v x -> Encoding # toJSONList :: [TestbenchReport v x] -> Value # toEncodingList :: [TestbenchReport v x] -> Encoding # | |
ToSample (TestbenchReport String Int) Source # | |
Methods toSamples :: Proxy (TestbenchReport String Int) -> [(Text, TestbenchReport String Int)] # | |
(Var v, Time t) => Viewable (Process t (StepInfo v x t)) (Process t StepInfoView) Source # | |
(Var v, Time t) => Viewable (StepInfo v x t) StepInfoView Source # | |
Methods view :: StepInfo v x t -> StepInfoView Source # | |
(UnitTag tag, VarValTimeJSON v x t) => Viewable (DefTree tag v x t) (NodeView tag v x t) Source # | |