Hoogle Search

Within LTS Haskell 24.40 (ghc-9.10.3)

Note that Stackage only displays results for the latest LTS and Nightly snapshot. Learn more.

  1. aside :: Html -> Html

    blaze-html Text.Blaze.XHtml5

    Combinator for the <aside> element. Example:

    aside $ span $ toHtml "foo"
    
    Result:
    <aside><span>foo</span></aside>
    

  2. video :: Html -> Html

    blaze-html Text.Blaze.XHtml5

    Combinator for the <video> element. Example:

    video $ span $ toHtml "foo"
    
    Result:
    <video><span>foo</span></video>
    

  3. formnovalidate :: AttributeValue -> Attribute

    blaze-html Text.Blaze.XHtml5.Attributes

    Combinator for the formnovalidate attribute. Example:

    div ! formnovalidate "bar" $ "Hello."
    
    Result:
    <div formnovalidate="bar">Hello.</div>
    

  4. hidden :: AttributeValue -> Attribute

    blaze-html Text.Blaze.XHtml5.Attributes

    Combinator for the hidden attribute. Example:

    div ! hidden "bar" $ "Hello."
    
    Result:
    <div hidden="bar">Hello.</div>
    

  5. novalidate :: AttributeValue -> Attribute

    blaze-html Text.Blaze.XHtml5.Attributes

    Combinator for the novalidate attribute. Example:

    div ! novalidate "bar" $ "Hello."
    
    Result:
    <div novalidate="bar">Hello.</div>
    

  6. oninvalid :: AttributeValue -> Attribute

    blaze-html Text.Blaze.XHtml5.Attributes

    Combinator for the oninvalid attribute. Example:

    div ! oninvalid "bar" $ "Hello."
    
    Result:
    <div oninvalid="bar">Hello.</div>
    

  7. onpagehide :: AttributeValue -> Attribute

    blaze-html Text.Blaze.XHtml5.Attributes

    Combinator for the onpagehide attribute. Example:

    div ! onpagehide "bar" $ "Hello."
    
    Result:
    <div onpagehide="bar">Hello.</div>
    

  8. width :: AttributeValue -> Attribute

    blaze-html Text.Blaze.XHtml5.Attributes

    Combinator for the width attribute. Example:

    div ! width "bar" $ "Hello."
    
    Result:
    <div width="bar">Hello.</div>
    

  9. package genvalidity

    Testing utilities for the validity library Note: There are companion instance packages for this library:

  10. module Data.GenValidity

    GenValid exists to make tests involving Validity types easier and speed up the generation of data for them. To implement tests for this datatype, we would have to be able to generate both primes. We could do this with a generator like this one:

    (Prime <$> 'arbitrary') `suchThat` isValid
    
    However, this is tedious and inefficient, as well as quite naive (because arbitrary tends to use very naive generators). The GenValid type class allows you to specify how to (efficiently) generate valid data of the given type to allow for easier and quicker testing. The default implementation of GenValid already gives you a generator and shrinking function for free:
    instance GenValid Prime
    
    For example, to generate primes, we don't have to consider even numbers other than 2. A more efficient implementation could then look as follows:
    instance GenValid Prime where
    genValid = Prime <$>
    (oneof
    [ pure 2
    , ((\y -> 2 * abs y + 1) <$> arbitrary) `suchThat` isPrime)
    ])
    
    Typical examples of tests involving validity could look as follows:
    it "succeeds when given valid input" $ do
    forAllValid $ \input ->
    myFunction input `shouldSatisfy` isRight
    
    it "produces valid output when it succeeds" $ do
    forAllValid $ \input ->
    case myFunction input of
    Nothing -> return () -- Can happen
    Just output -> output `shouldSatisfy` isValid
    
    Definitely also look at the companion packages for more info on how to use this package.

Page 424 of many | Previous | Next