{-# language OverloadedStrings #-}

module FastDownward.SAS.UseCosts ( UseCosts(..), toSAS ) where

import qualified Data.Text.Lazy.Builder


data UseCosts =
  UseCosts | NoCosts
  deriving
    ( Int -> UseCosts -> ShowS
[UseCosts] -> ShowS
UseCosts -> String
(Int -> UseCosts -> ShowS)
-> (UseCosts -> String) -> ([UseCosts] -> ShowS) -> Show UseCosts
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UseCosts] -> ShowS
$cshowList :: [UseCosts] -> ShowS
show :: UseCosts -> String
$cshow :: UseCosts -> String
showsPrec :: Int -> UseCosts -> ShowS
$cshowsPrec :: Int -> UseCosts -> ShowS
Show )


toSAS :: UseCosts -> Data.Text.Lazy.Builder.Builder
toSAS :: UseCosts -> Builder
toSAS UseCosts
a =
     Builder
"begin_metric\n"
  Builder -> Builder -> Builder
forall a. Semigroup a => a -> a -> a
<> case UseCosts
a of
      UseCosts
NoCosts ->
        Builder
"0\n"

      UseCosts
UseCosts ->
        Builder
"1\n"
  Builder -> Builder -> Builder
forall a. Semigroup a => a -> a -> a
<> Builder
"end_metric"