<commit_before>module Util.Types where

import Prelude ((<$>), div)
import Data.Int (toNumber)
import Data.Show (class Show)
import Data.Ord (class Ord, compare)
import Data.Eq (class Eq, eq)

import Data.Argonaut hiding (toNumber)
import Color (Color, toRGBA, toHSLA, toHexString)

newtype Color' = Color' Color
newtype Colors' = Colors' (Array Color')

instance eqColor :: Eq Color' where
  eq (Color' c1) (Color' c2) = eq c1 c2

instance ordColor :: Ord Color' where
  compare (Color' c1) (Color' c2) = compare hsla1.h hsla2.h where
    hsla1 = toHSLA c1
    hsla2 = toHSLA c2
<commit_msg>Sort by luminance<commit_after>module Util.Types where

import Prelude ((<$>), div)
import Data.Int (toNumber)
import Data.Show (class Show)
import Data.Ord (class Ord, compare)
import Data.Eq (class Eq, eq)

import Data.Argonaut hiding (toNumber)
import Color (Color, toRGBA, toHSLA, toHexString)

newtype Color' = Color' Color
newtype Colors' = Colors' (Array Color')

instance eqColor :: Eq Color' where
  eq (Color' c1) (Color' c2) = eq c1 c2

instance ordColor :: Ord Color' where
  compare (Color' c1) (Color' c2) = compare hsla1.l hsla2.l where
    hsla1 = toHSLA c1
    hsla2 = toHSLA c2

{'fraction_non_alphanumeric': 0.1127946127946128, 'fraction_numerical': 0.020202020202020204, 'mean_word_length': 4.380090497737557, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2315322', 'n_tokens_mistral': 445, 'n_tokens_neox': 434, 'n_words': 152}