Skip to content

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
    • Help
    • Submit feedback
    • Contribute to GitLab
  • Sign in
haskell-gargantext
haskell-gargantext
  • Project
    • Project
    • Details
    • Activity
    • Releases
    • Cycle Analytics
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Charts
  • Issues 165
    • Issues 165
    • List
    • Board
    • Labels
    • Milestones
  • Merge Requests 9
    • Merge Requests 9
  • CI / CD
    • CI / CD
    • Pipelines
    • Jobs
    • Schedules
    • Charts
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Members
    • Members
  • Collapse sidebar
  • Activity
  • Graph
  • Charts
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
  • gargantext
  • haskell-gargantexthaskell-gargantext
  • Merge Requests
  • !261

Merged
Opened 1 year ago by Alfredo Di Napoli@AlfredoDiNapoli
  • Report abuse
Report abuse

Drop 'All' data constructor from 'Lang'

Historically we weren't very disciplined in how we passed around a Lang on which perform corpus search. Not only that, but our Lang type had (before this MR) an All data constructor which morally didn't belong to the Lang type, which is clearly a bounded enumeration of all the languages that we support for corpus search and stemming. Furthermore, these days the frontend is always going to send us a valid Lang to begin with, i.e. if the ExternalAPIs provider doesn't support searching for a language or the user didn't pick a language to filter the corpus to begin with, the frontend will default to EN. If we really don't care about the language the provider should search for, we can always just use Maybe Lang in the relevant API function for the given provider.

Removing the All data constructor from the Lang datatype has several benifits, the main one being that we now have total functions for things like toISO693.

This will make possible to write an uniform interface for stemming stem :: Lang -> StemmingAlgorithm -> T.Text -> T.Text, as now Lang will always map to a valid (ISO693) language.

While this could technically be merged, it's a stepping stone for #324 (closed).

Edited 1 year ago by Alfredo Di Napoli

Check out, review, and merge locally

Step 1. Fetch and check out the branch for this merge request

git fetch origin
git checkout -b adinapoli/issue-324 origin/adinapoli/issue-324

Step 2. Review the changes locally

Step 3. Merge the branch and fix any conflicts that come up

git fetch origin
git checkout origin/dev
git merge --no-ff adinapoli/issue-324

Step 4. Push the result of the merge to GitLab

git push origin dev

Note that pushing to GitLab requires write access to this repository.

Tip: You can also checkout merge requests locally by following these guidelines.

Request to merge adinapoli/issue-324 into dev
  • Email patches
  • Plain diff
Pipeline #5725 passed for 63fcd605 on adinapoli/issue-324

          Merged by delanoe 1 year ago

          The changes were merged into dev with 63fcd605

          Mentions #324 (closed)

          • Discussion 9
          • Commits 1
          • Pipelines 2
          • Changes 6
          • Loading...
          • You're only seeing other activity in the feed. To add a comment, switch to one of the following options.
          Please register or sign in to reply
          Assignee
          Assign to
          None
          Milestone
          None
          Assign milestone
          None
          Time tracking
          No estimate or time spent
          2
          Labels
          Feedback request Ready to merge
          Assign labels
          • View project labels
          Lock merge request
          Unlocked
          participants
          Reference: gargantext/haskell-gargantext!261

          Revert this commit

          This will create a new commit in order to revert the existing changes.

          Switch branch
          Cancel
          A new branch will be created in your fork and a new merge request will be started.

          Cherry-pick this commit

          Switch branch
          Cancel
          A new branch will be created in your fork and a new merge request will be started.