@@ -139,9 +139,9 @@ module Clash.Signal.Internal
139
139
, testFor
140
140
-- * Type classes
141
141
-- ** 'Eq'-like
142
- , (.==.) , (./=.)
142
+ , (.==.) , (.==) , (==.) , (./=.) , (./=) , ( /=.)
143
143
-- ** 'Ord'-like
144
- , (.<.) , (.<=.) , (.>=.) , (.>.)
144
+ , (.<.) , (.<) , (<.) , (.< =.) , (.<=) , (<=.) , (. >=.) , (.>=) , (>=.) , (.>.) , (.>) , ( >.)
145
145
-- ** 'Functor'
146
146
, mapSignal #
147
147
-- ** 'Applicative'
@@ -1436,6 +1436,30 @@ infix 4 .==.
1436
1436
(.==.) :: (Eq a , Applicative f ) => f a -> f a -> f Bool
1437
1437
(.==.) = liftA2 (==)
1438
1438
1439
+ infix 4 .==
1440
+ -- | The above type is a generalization for:
1441
+ --
1442
+ -- @
1443
+ -- __(.==)__ :: 'Eq' a => 'Clash.Signal.Signal' a -> a -> 'Clash.Signal.Signal' 'Bool'
1444
+ -- @
1445
+ --
1446
+ -- It is a version of ('==') that allows comparing a @'Clash.Signal.Signal' a@ with a
1447
+ -- constant @a@ and returns a 'Clash.Signal.Signal' of 'Bool'
1448
+ (.==) :: (Eq a , Applicative f ) => f a -> a -> f Bool
1449
+ (.==) a b = fmap (== b) a
1450
+
1451
+ infix 4 ==.
1452
+ -- | The above type is a generalization for:
1453
+ --
1454
+ -- @
1455
+ -- __(==.)__ :: 'Eq' a => a -> 'Clash.Signal.Signal' a -> 'Clash.Signal.Signal' 'Bool'
1456
+ -- @
1457
+ --
1458
+ -- It is a version of ('==') that allows comparing a @'Clash.Signal.Signal' a@ with a
1459
+ -- constant @a@ and returns a 'Clash.Signal.Signal' of 'Bool'
1460
+ (==.) :: (Eq a , Applicative f ) => a -> f a -> f Bool
1461
+ (==.) a b = fmap (a== ) b
1462
+
1439
1463
infix 4 ./=.
1440
1464
-- | The above type is a generalization for:
1441
1465
--
@@ -1447,6 +1471,31 @@ infix 4 ./=.
1447
1471
(./=.) :: (Eq a , Applicative f ) => f a -> f a -> f Bool
1448
1472
(./=.) = liftA2 (/=)
1449
1473
1474
+ infix 4 ./=
1475
+ -- | The above type is a generalization for:
1476
+ --
1477
+ -- @
1478
+ -- __(./=)__ :: 'Eq' a => 'Clash.Signal.Signal' a -> a -> 'Clash.Signal.Signal' 'Bool'
1479
+ -- @
1480
+ --
1481
+ -- It is a version of ('/=') that allows comparing a @'Clash.Signal.Signal' a@ with a
1482
+ -- constant @a@ and returns a 'Clash.Signal.Signal' of 'Bool'
1483
+ (./=) :: (Eq a , Applicative f ) => f a -> a -> f Bool
1484
+ (./=) a b = fmap (/= b) a
1485
+
1486
+ infix 4 /=.
1487
+ -- | The above type is a generalization for:
1488
+ --
1489
+ -- @
1490
+ -- __(/=.)__ :: 'Eq' a => a -> 'Clash.Signal.Signal' a -> 'Clash.Signal.Signal' 'Bool'
1491
+ -- @
1492
+ --
1493
+ -- It is a version of ('/=') that allows comparing a @'Clash.Signal.Signal' a@ with a
1494
+ -- constant @a@ and returns a 'Clash.Signal.Signal' of 'Bool'
1495
+
1496
+ (/=.) :: (Eq a , Applicative f ) => a -> f a -> f Bool
1497
+ (/=.) a b = fmap (a /= ) b
1498
+
1450
1499
infix 4 .<.
1451
1500
-- | The above type is a generalization for:
1452
1501
--
@@ -1458,6 +1507,30 @@ infix 4 .<.
1458
1507
(.<.) :: (Ord a , Applicative f ) => f a -> f a -> f Bool
1459
1508
(.<.) = liftA2 (<)
1460
1509
1510
+ infix 4 <.
1511
+ -- | The above type is a generalization for:
1512
+ --
1513
+ -- @
1514
+ -- __(<.)__ :: 'Ord' a => a -> 'Clash.Signal.Signal' a -> 'Clash.Signal.Signal' 'Bool'
1515
+ -- @
1516
+ --
1517
+ -- It is a version of ('<') that allows comparing a @'Clash.Signal.Signal' a@ with a constant
1518
+ -- @a@ and returns a 'Clash.Signal.Signal' of 'Bool'
1519
+ (<.) :: (Ord a , Applicative f ) => a -> f a -> f Bool
1520
+ (<.) a b = fmap (a< ) b
1521
+
1522
+ infix 4 .<
1523
+ -- | The above type is a generalization for:
1524
+ --
1525
+ -- @
1526
+ -- __(.<)__ :: 'Ord' a => 'Clash.Signal.Signal' a -> a -> 'Clash.Signal.Signal' 'Bool'
1527
+ -- @
1528
+ --
1529
+ -- It is a version of ('<') that allows comparing a @'Clash.Signal.Signal' a@ with a constant
1530
+ -- @a@ and returns a 'Clash.Signal.Signal' of 'Bool'
1531
+ (.<) :: (Ord a , Applicative f ) => f a -> a -> f Bool
1532
+ (.<) a b = fmap (< b) a
1533
+
1461
1534
infix 4 .<=.
1462
1535
-- | The above type is a generalization for:
1463
1536
--
@@ -1469,6 +1542,30 @@ infix 4 .<=.
1469
1542
(.<=.) :: (Ord a , Applicative f ) => f a -> f a -> f Bool
1470
1543
(.<=.) = liftA2 (<=)
1471
1544
1545
+ infix 4 .<=
1546
+ -- | The above type is a generalization for:
1547
+ --
1548
+ -- @
1549
+ -- __(.<=)__ :: 'Ord' a => 'Clash.Signal.Signal' a -> a -> 'Clash.Signal.Signal' 'Bool'
1550
+ -- @
1551
+ --
1552
+ -- It is a version of ('GHC.TypeNats.<=') that allows comparing a @'Clash.Signal.Signal' a@ with a constant
1553
+ -- @a@ and returns a 'Clash.Signal.Signal' of 'Bool'
1554
+ (.<=) :: (Ord a , Applicative f ) => f a -> a -> f Bool
1555
+ (.<=) a b = fmap (<= b) a
1556
+
1557
+ infix 4 <=.
1558
+ -- | The above type is a generalization for:
1559
+ --
1560
+ -- @
1561
+ -- __(<=.)__ :: 'Ord' a => a -> 'Clash.Signal.Signal' a -> 'Clash.Signal.Signal' 'Bool'
1562
+ -- @
1563
+ --
1564
+ -- It is a version of ('GHC.TypeNats.<=') that allows comparing a @'Clash.Signal.Signal' a@ with a constant
1565
+ -- @a@ and returns a 'Clash.Signal.Signal' of 'Bool'
1566
+ (<=.) :: (Ord a , Applicative f ) => a -> f a -> f Bool
1567
+ (<=.) a b = fmap (a<= )b
1568
+
1472
1569
infix 4 .>.
1473
1570
-- | The above type is a generalization for:
1474
1571
--
@@ -1480,6 +1577,30 @@ infix 4 .>.
1480
1577
(.>.) :: (Ord a , Applicative f ) => f a -> f a -> f Bool
1481
1578
(.>.) = liftA2 (>)
1482
1579
1580
+ infix 4 .>
1581
+ -- | The above type is a generalization for:
1582
+ --
1583
+ -- @
1584
+ -- __(.>)__ :: 'Ord' a => 'Clash.Signal.Signal' a -> a -> 'Clash.Signal.Signal' 'Bool'
1585
+ -- @
1586
+ --
1587
+ -- It is a version of ('>') that allows comparing a @'Clash.Signal.Signal' a@ with a constant
1588
+ -- @a@ and returns a 'Clash.Signal.Signal' of 'Bool'
1589
+ (.>) :: (Ord a , Applicative f ) => f a -> a -> f Bool
1590
+ (.>) a b = fmap (> b) a
1591
+
1592
+ infix 4 >.
1593
+ -- | The above type is a generalization for:
1594
+ --
1595
+ -- @
1596
+ -- __(>.)__ :: 'Ord' a => a -> 'Clash.Signal.Signal' a -> 'Clash.Signal.Signal' 'Bool'
1597
+ -- @
1598
+ --
1599
+ -- It is a version of ('>') that allows comparing a @'Clash.Signal.Signal' a@ with a constant
1600
+ -- @a@ and returns a 'Clash.Signal.Signal' of 'Bool'
1601
+ (>.) :: (Ord a , Applicative f ) => a -> f a -> f Bool
1602
+ (>.) a b = fmap (a> ) b
1603
+
1483
1604
infix 4 .>=.
1484
1605
-- | The above type is a generalization for:
1485
1606
--
@@ -1491,6 +1612,30 @@ infix 4 .>=.
1491
1612
(.>=.) :: (Ord a , Applicative f ) => f a -> f a -> f Bool
1492
1613
(.>=.) = liftA2 (>=)
1493
1614
1615
+ infix 4 .>=
1616
+ -- | The above type is a generalization for:
1617
+ --
1618
+ -- @
1619
+ -- __(.>=)__ :: 'Ord' a => 'Clash.Signal.Signal' a -> a -> 'Clash.Signal.Signal' 'Bool'
1620
+ -- @
1621
+ --
1622
+ -- It is a version of ('>=') that allows comparing a @'Clash.Signal.Signal' a@ with a constant
1623
+ -- @a@ and returns a 'Clash.Signal.Signal' of 'Bool'
1624
+ (.>=) :: (Ord a , Applicative f ) => f a -> a -> f Bool
1625
+ (.>=) a b = fmap (>= b) a
1626
+
1627
+ infix 4 >=.
1628
+ -- | The above type is a generalization for:
1629
+ --
1630
+ -- @
1631
+ -- __(>=.)__ :: 'Ord' a => a -> 'Clash.Signal.Signal' a -> 'Clash.Signal.Signal' 'Bool'
1632
+ -- @
1633
+ --
1634
+ -- It is a version of ('>=') that allows comparing a @'Clash.Signal.Signal' a@ with a constant
1635
+ -- @a@ and returns a 'Clash.Signal.Signal' of 'Bool'
1636
+ (>=.) :: (Ord a , Applicative f ) => a -> f a -> f Bool
1637
+ (>=.) a b = fmap (a>= ) b
1638
+
1494
1639
instance Fractional a => Fractional (Signal dom a ) where
1495
1640
(/) = liftA2 (/)
1496
1641
recip = fmap recip
0 commit comments