never executed always true always false
    1 {- |
    2 Module      : NITTA.UIBackend.Types
    3 Description : Types for UI backend.
    4 Copyright   : (c) Aleksandr Penskoi, 2021
    5 License     : BSD3
    6 Maintainer  : aleksandr.penskoi@gmail.com
    7 Stability   : experimental
    8 -}
    9 module NITTA.UIBackend.Types (
   10     BackendCtx (..),
   11 ) where
   12 
   13 import Data.Default
   14 import Data.Text qualified as T
   15 import NITTA.Synthesis.MlBackend.ServerInstance
   16 import NITTA.Synthesis.Types
   17 
   18 data BackendCtx tag v x t = BackendCtx
   19     { root :: DefTree tag v x t
   20     -- ^ root synthesis node
   21     , receivedValues :: [(v, [x])]
   22     -- ^ lists of received by IO values
   23     , outputPath :: String
   24     , mlBackendGetter :: IO MlBackendServer
   25     , nodeScores :: [T.Text]
   26     -- ^ list of node scores name. Used for ML backend mostly, but can be used
   27     -- for any "hardcoded" scoring function.
   28     }
   29 
   30 instance Default (BackendCtx tag v x t) where
   31     def =
   32         BackendCtx
   33             { root = error "root of a default (missing) BackendCtx was accessed"
   34             , receivedValues = def
   35             , outputPath = def
   36             , mlBackendGetter = def
   37             , nodeScores = def
   38             }