<commit_before>-- | This module defines a type of _link targets_, which can be used as the target of a hyperlink or button.
-- |
-- | This type is quite useful when defining reusable components.

module Halogen.HTML.Target
  ( URL()
  , url
  , runURL

  , Target(..)
  , target
  ) where

import Control.Functor (($>))

import Control.Alt

import qualified Halogen.HTML as H
import qualified Halogen.HTML.Attributes as A
import qualified Halogen.HTML.Events as E
import qualified Halogen.HTML.Events.Handler as E

-- | A type-safe wrapper for a URL
data URL = URL String

-- | Create a `URL`<commit_msg>EQ, Semigroup and Show instances or URL<commit_after>-- | This module defines a type of _link targets_, which can be used as the target of a hyperlink or button.
-- |
-- | This type is quite useful when defining reusable components.

module Halogen.HTML.Target
  ( URL()
  , url
  , runURL

  , Target(..)
  , target
  ) where

import Control.Functor (($>))

import Control.Alt

import qualified Halogen.HTML as H
import qualified Halogen.HTML.Attributes as A
import qualified Halogen.HTML.Events as E
import qualified Halogen.HTML.Events.Handler as E

-- | A type-safe wrapper for a URL
data URL = URL String

instance eqURL :: Eq URL where
  (==) (URL a) (URL b) = a == b
  (/=) a       b       = not (a == b)

instance semigroupURL :: Semigroup URL where
  (<>) (URL a) (URL b) = URL (a <> b)

instance showURL :: Show URL where
  show (URL a) = "url " ++ show a

-- | Create a `URL`
{'fraction_non_alphanumeric': 0.10536912751677853, 'fraction_numerical': 0.0, 'mean_word_length': 3.1532033426183843, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 7, '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': '491983', 'n_tokens_mistral': 470, 'n_tokens_neox': 459, 'n_words': 194}