{-# OPTIONS_HADDOCK show-extensions #-}

-- |
-- Module      :  Phonetic.Languages.Array.Ukrainian.PropertiesFuncRepG2DiverseOld
-- Copyright   :  (c) OleksandrZhabenko 2020-2022
-- 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.PropertiesFuncRepG2DiverseOld (
  -- * Functions with 'Int16'
  procDiverse2I
  -- ** Usual ones
  , procDiverse2F
) where

import GHC.Int
import GHC.Arr (Array)
import Phonetic.Languages.UniquenessPeriodsG
import Phonetic.Languages.Basis
import GHC.Float (int2Double)
import Melodics.Ukrainian.ArrInt8

procDiverse2I
  :: (Ord c) => (Int16 -> c)
  -> FuncRep2 String Int16 c
procDiverse2I :: (Int16 -> c) -> FuncRep2 String Int16 c
procDiverse2I Int16 -> c
g = (String -> Int16) -> (Int16 -> c) -> FuncRep2 String Int16 c
forall a b c. (a -> b) -> (b -> c) -> FuncRep2 a b c
D ([Int8] -> [Int8] -> Int16
forall (t :: * -> *). Foldable t => [Int8] -> t Int8 -> Int16
diverse2GLInt8 [-Int8
1,Int8
0] ([Int8] -> Int16) -> (String -> [Int8]) -> String -> Int16
forall b c a. (b -> c) -> (a -> b) -> a -> c
. String -> [Int8]
convertToProperUkrainianI8) Int16 -> c
g
{-# INLINE procDiverse2I #-}

procDiverse2F
  :: (Ord c) => (Double -> c)
  -> FuncRep2 String Double c
procDiverse2F :: (Double -> c) -> FuncRep2 String Double c
procDiverse2F Double -> c
g = (String -> Double) -> (Double -> c) -> FuncRep2 String Double c
forall a b c. (a -> b) -> (b -> c) -> FuncRep2 a b c
D (Int -> Double
int2Double (Int -> Double) -> (String -> Int) -> String -> Double
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Int16 -> Int
forall a. Enum a => a -> Int
fromEnum (Int16 -> Int) -> (String -> Int16) -> String -> Int
forall b c a. (b -> c) -> (a -> b) -> a -> c
. [Int8] -> [Int8] -> Int16
forall (t :: * -> *). Foldable t => [Int8] -> t Int8 -> Int16
diverse2GLInt8 [-Int8
1,Int8
0] ([Int8] -> Int16) -> (String -> [Int8]) -> String -> Int16
forall b c a. (b -> c) -> (a -> b) -> a -> c
. String -> [Int8]
convertToProperUkrainianI8) Double -> c
g
{-# INLINE procDiverse2F #-}