packages feed

phonetic-languages-simplified-generalized-examples-common-0.6.1.0: Phladiprelio/General/SimpleConstraints.hs

-- |
-- Module      :  Phladiprelio.General.SimpleConstraints
-- Copyright   :  (c) Oleksandr Zhabenko 2020-2023
-- License     :  MIT
-- Stability   :  Experimental
-- Maintainer  :  oleksandr.zhabenko@yahoo.com
--
-- Some code shared for different Main modules.
-- Is taken from the module Phladiprelio.Simplified.SimpleConstraints from the
-- @phonetic-languages-simplified-examples-common@ package.

{-# LANGUAGE NoImplicitPrelude #-}

module Phladiprelio.General.SimpleConstraints where

import GHC.Base
import GHC.Num ((-))
import GHC.List (concatMap)
import Text.Show (show)

showB :: Int -> Bool -> String
showB n bool
 | n >= 2 && bool == True = 'B':show (n - 1) `mappend` concatMap show [0..n - 2]
 | otherwise = ""