-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: use
F[_]
instead of M[_]
for Higher-Kinded Types
- Loading branch information
1 parent
2dd0778
commit 7a6cb89
Showing
46 changed files
with
180 additions
and
180 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 6 additions & 6 deletions
12
src/main/scala/net/yoshinorin/qualtet/domains/authors/AuthorRepository.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,43 +1,43 @@ | ||
package net.yoshinorin.qualtet.domains.authors | ||
|
||
trait AuthorRepository[M[_]] { | ||
trait AuthorRepository[F[_]] { | ||
|
||
/** | ||
* get all Author | ||
* | ||
* @return Authors | ||
*/ | ||
def getAll(): M[Seq[ResponseAuthor]] | ||
def getAll(): F[Seq[ResponseAuthor]] | ||
|
||
/** | ||
* create a authorName | ||
* | ||
* @param data Instance of Author | ||
* @return dummy long id (Doobie return Int) | ||
*/ | ||
def upsert(data: Author): M[Int] | ||
def upsert(data: Author): F[Int] | ||
|
||
/** | ||
* find a Author by id | ||
* | ||
* @param id authorName's id | ||
* @return Author | ||
*/ | ||
def findById(id: AuthorId): M[Option[ResponseAuthor]] | ||
def findById(id: AuthorId): F[Option[ResponseAuthor]] | ||
|
||
/** | ||
* find a Author by id | ||
* | ||
* @param id authorName's id | ||
* @return Author | ||
*/ | ||
def findByIdWithPassword(id: AuthorId): M[Option[Author]] | ||
def findByIdWithPassword(id: AuthorId): F[Option[Author]] | ||
|
||
/** | ||
* find a Author by name | ||
* | ||
* @param name authorName's name | ||
* @return Author | ||
*/ | ||
def findByName(name: AuthorName): M[Option[ResponseAuthor]] | ||
def findByName(name: AuthorName): F[Option[ResponseAuthor]] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 4 additions & 4 deletions
8
src/main/scala/net/yoshinorin/qualtet/domains/contentTypes/ContentTypeRepository.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
package net.yoshinorin.qualtet.domains.contentTypes | ||
|
||
trait ContentTypeRepository[M[_]] { | ||
def upsert(data: ContentType): M[Int] | ||
def getAll(): M[Seq[ContentType]] | ||
def findByName(name: String): M[Option[ContentType]] | ||
trait ContentTypeRepository[F[_]] { | ||
def upsert(data: ContentType): F[Int] | ||
def getAll(): F[Seq[ContentType]] | ||
def findByName(name: String): F[Option[ContentType]] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
src/main/scala/net/yoshinorin/qualtet/domains/search/SearchRepository.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
package net.yoshinorin.qualtet.domains.search | ||
|
||
trait SearchRepository[M[_]] { | ||
def search(query: List[String]): M[Seq[(Int, ResponseSearch)]] | ||
trait SearchRepository[F[_]] { | ||
def search(query: List[String]): F[Seq[(Int, ResponseSearch)]] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 4 additions & 4 deletions
8
src/main/scala/net/yoshinorin/qualtet/domains/series/SeriesRepository.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
package net.yoshinorin.qualtet.domains.series | ||
|
||
trait SeriesRepository[M[_]] { | ||
def upsert(data: Series): M[Int] | ||
def findByName(name: SeriesName): M[Option[Series]] | ||
def getAll(): M[Seq[Series]] | ||
trait SeriesRepository[F[_]] { | ||
def upsert(data: Series): F[Int] | ||
def findByName(name: SeriesName): F[Option[Series]] | ||
def getAll(): F[Seq[Series]] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.