packages feed

phonetic-languages-permutations-array-0.3.3.0: Phonetic/Languages/Permutations/Represent.hs

-- |
-- Module      :  Phonetic.Languages.Permutations.Represent
-- Copyright   :  (c) OleksandrZhabenko 2022
-- License     :  MIT
-- Stability   :  Experimental
-- Maintainer  :  olexandr543@yahoo.com
--
-- Permutations data type to mark the needed permutations type from the other modules.

module Phonetic.Languages.Permutations.Represent (
  PermutationsType(..)
  , bTransform2Perms
) where

import Data.Monoid

data PermutationsType = P Int deriving (Eq, Ord)

instance Show PermutationsType where
  show (P x) = "+p " `mappend` show x

bTransform2Perms :: [String] -> PermutationsType
bTransform2Perms ys
 | ys == ["1"] = P 1
 | ys == ["2"] = P 2
 | otherwise = P 0