{-# LANGUAGE NoImplicitPrelude #-}

-- |
-- Module      :  Phladiprelio.PermutationsRepresent
-- Copyright   :  (c) OleksandrZhabenko 2022-2023
-- License     :  MIT
-- Stability   :  Experimental
-- Maintainer  :  oleksandr.zhabenko@yahoo.com
--
-- Permutations data type to mark the needed permutations type from the other modules.

module Phladiprelio.PermutationsRepresent (
  PermutationsType(..)
  , bTransform2Perms
) where

import GHC.Base
import Text.Show
--import Data.Monoid

data PermutationsType = P Int deriving (PermutationsType -> PermutationsType -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PermutationsType -> PermutationsType -> Bool
$c/= :: PermutationsType -> PermutationsType -> Bool
== :: PermutationsType -> PermutationsType -> Bool
$c== :: PermutationsType -> PermutationsType -> Bool
Eq, Eq PermutationsType
PermutationsType -> PermutationsType -> Bool
PermutationsType -> PermutationsType -> Ordering
PermutationsType -> PermutationsType -> PermutationsType
forall a.
Eq a
-> (a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
min :: PermutationsType -> PermutationsType -> PermutationsType
$cmin :: PermutationsType -> PermutationsType -> PermutationsType
max :: PermutationsType -> PermutationsType -> PermutationsType
$cmax :: PermutationsType -> PermutationsType -> PermutationsType
>= :: PermutationsType -> PermutationsType -> Bool
$c>= :: PermutationsType -> PermutationsType -> Bool
> :: PermutationsType -> PermutationsType -> Bool
$c> :: PermutationsType -> PermutationsType -> Bool
<= :: PermutationsType -> PermutationsType -> Bool
$c<= :: PermutationsType -> PermutationsType -> Bool
< :: PermutationsType -> PermutationsType -> Bool
$c< :: PermutationsType -> PermutationsType -> Bool
compare :: PermutationsType -> PermutationsType -> Ordering
$ccompare :: PermutationsType -> PermutationsType -> Ordering
Ord)

instance Show PermutationsType where
  show :: PermutationsType -> String
show (P Int
x) = String
"+p " forall a. Monoid a => a -> a -> a
`mappend` forall a. Show a => a -> String
show Int
x

bTransform2Perms :: [String] -> PermutationsType
bTransform2Perms :: [String] -> PermutationsType
bTransform2Perms [String]
ys
 | [String]
ys forall a. Eq a => a -> a -> Bool
== [String
"1"] = Int -> PermutationsType
P Int
1
 | [String]
ys forall a. Eq a => a -> a -> Bool
== [String
"2"] = Int -> PermutationsType
P Int
2
 | Bool
otherwise = Int -> PermutationsType
P Int
0