packages feed

phonetic-languages-simplified-properties-array-0.12.0.0: Phonetic/Languages/Array/Ukrainian/PropertiesFuncRepG2Diverse.hs

{-# OPTIONS_HADDOCK show-extensions #-}

-- |
-- Module      :  Phonetic.Languages.Array.Ukrainian.PropertiesFuncRepG2Diverse
-- Copyright   :  (c) OleksandrZhabenko 2020-2021
-- License     :  MIT
-- Stability   :  Experimental
-- Maintainer  :  olexandr543@yahoo.com
--
-- Generalization of the functionality of the DobutokO.Poetry.Norms
-- and DobutokO.Poetry.Norms.Extended modules
-- from the @dobutokO-poetry@ package. Instead of vectors, uses arrays.

module Phonetic.Languages.Array.Ukrainian.PropertiesFuncRepG2Diverse (
  -- * Functions with 'Int16'
  procDiverse2I
  -- ** Usual ones
  , procDiverse2F
) where

import GHC.Int
import Phonetic.Languages.Simplified.Lists.UniquenessPeriodsG.Base
import Phonetic.Languages.Simplified.DataG.Base
import GHC.Float (int2Double)
import Melodics.Ukrainian.ArrInt8

procDiverse2I
  :: (Ord c) => (Int16 -> c)
  -> FuncRep2 String Int16 c
procDiverse2I g = D (diverse2GLInt8 [-1,0] . convertToProperUkrainianI8) g
{-# INLINE procDiverse2I #-}

procDiverse2F
  :: (Ord c) => (Double -> c)
  -> FuncRep2 String Double c
procDiverse2F g = D (int2Double . fromEnum . diverse2GLInt8 [-1,0] . convertToProperUkrainianI8) g
{-# INLINE procDiverse2F #-}