summaryrefslogtreecommitdiffstats
path: root/src/act4e_solutions/maps.py
blob: 8f161f431328540abd1fbef94756d825c43def7b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
from typing import overload, TypeVar

import act4e_interfaces as I

A = TypeVar("A")
B = TypeVar("B")
C = TypeVar("C")


class SolFiniteMapOperations(I.FiniteMapOperations):
    @overload
    def identity(self, s: I.FiniteSet[A]) -> I.FiniteMap[A, A]:
        ... # this is just a type declaration - do not implement

    @overload
    def identity(self, s: I.Setoid[A]) -> I.Mapping[A, A]:
        ... # this is just a type declaration - do not implement

    def identity(self, s: I.Setoid[A]) -> I.Mapping[A, A]:
        raise NotImplementedError() # implement here

    #

    def compose(self, f: I.FiniteMap[A, B], g: I.FiniteMap[B, C]) -> I.FiniteMap[A, C]:
        raise NotImplementedError()